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 tensorflow #106

Open
vignashrs opened this issue Dec 17, 2019 · 5 comments
Open

ImportError: No module named tensorflow #106

vignashrs opened this issue Dec 17, 2019 · 5 comments

Comments

@vignashrs
Copy link

Any one please help me out from the error which i couldn't overcome for a week???

after using the below command

python3 generate_tfrecord.py --csv_input=data/train_labels.csv --output_path=data/train.record --image_dir=images/

I received the following error

Traceback (most recent call last):
File "generate_tfrecord.py", line 16, in
import tensorflow as tf
ImportError: No module named tensorflow

To overcome this error????

@vignashrs
Copy link
Author

also facing , this error?
flags = tf.app.flags
AttributeError: module 'tensorflow' has no attribute 'app'
anybody please help me out??

@jod98
Copy link

jod98 commented Dec 19, 2019

Replace "import tensorflow as tf" with "import tensorflow.compat.v1 as tf" if you are using Tensorflow 2.0 or greater :)

@vignashrs
Copy link
Author

vignashrs commented Dec 19, 2019

thanks @jod98 for your response and help
Now im getting below kind of error???

import tensorflow.compat.v1 as tf
ModuleNotFoundError: No module named 'tensorflow.compat'

could u please help me to overcome?

@jod98
Copy link

jod98 commented Dec 19, 2019

I am having a similar same error. I am trying to convert my .csv file to a 'tfrecord' file. I was using tensorflow 2.0 but I heard that it wasn't supported for object_detection (what I am trying to do). I tried tensorflow 1.14 and 1.15 but still get an error. I am going to try used github repository branch for tensorflow 1.* and create my tfrecords file that way. I will let you know if I get it :)

@himanshisyadav
Copy link

Getting the following error with TF 1.12.0. I was using 1.14.0 before and had issues.

/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) Traceback (most recent call last): File "autoencoder_test_MLP_basic.py", line 24, in <module> from deephyp import autoencoder File "../deephyp/autoencoder.py", line 16, in <module> import tensorflow.compat.v1 as tf ImportError: No module named 'tensorflow.compat.v1'

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

3 participants