Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named contrib.slim #32

Open
HamzaKhalloufi opened this issue Oct 27, 2020 · 4 comments
Open

ImportError: No module named contrib.slim #32

HamzaKhalloufi opened this issue Oct 27, 2020 · 4 comments

Comments

@HamzaKhalloufi
Copy link

I get this error message after succefully getting json files
I tried several tensorflow versions but I still get the same error
Processing How001
Traceback (most recent call last):
File "hmr/demo.py", line 33, in
from src.RunModel import RunModel
File "/content/hmr/src/RunModel.py", line 13, in
from .models import get_encoder_fn_separate
File "/content/hmr/src/models.py", line 19, in
import tensorflow.contrib.slim as slim
ImportError: No module named contrib.slim

@andreixxi
Copy link

@HamzaKhalloufi try this: https://github.com/google-research/tf-slim

I used pip install --upgrade tf_slim and then in another cell this: import tf_slim as slim. also comment the import in the script, it did the trick for me.

@tuanfeng
Copy link

the problem is with contrib, not slim. use tensorflow 1.15 will solve the problem.

@nimishmagre
Copy link

the problem is with contrib, not slim. use tensorflow 1.15 will solve the problem.

tried that but now I'm getting new errors like
ImportError: Traceback (most recent call last):
File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: dynamic module does not define init function (init_pywrap_tensorflow_internal)

@galaktyk
Copy link

galaktyk commented Apr 2, 2021

It because colab now use tensorflow2 as default and the 'contrib' module is not available anymore.
So I've made a Tensorflow lite-version of this repo here -->
https://github.com/galaktyk/mocap-hmr-tflite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants