When importing Numpy Keras Tensorflow I recieve this error
File "c:/Users//AppData/Local/Programs/Python/Python36/lib/site-packages/numpy/__config__.py", line 12, in <module> os.add_dll_directory(extra_dll_dir) AttributeError: module 'os' has no attribute 'add_dll_directory'
I have tried uninstalling and re installing numpy keras and tensorflow but this issue still remains, please help.
I have tried running this in other environments such as Replit but it still doesnt work.
Related
I have just upgraded tensorflow to the 2.11.0 version but I am having issues while importing packages.
In particular, while importing the 'compat' and the 'keras' modules I got the following errors:
import tensorflow.compat.v2 as tf
ModuleNotFoundError: No module named 'tensorflow.compat'
from tensorflow import keras
ImportError: cannot import name 'keras' from 'tensorflow' (unknown location)
What can be the reason of these import errors? I never had them before but I had to upgrade to the 2.11.0
I have tryied to unistall and re-install but I always get the same issue.
I need the 2.11.0 since otherwise I have issues with the 'build' method for optimizers in the tf.keras.optimizers module
I downloaded the seaborn module and I am unable to use the heatmap function in Spyder (latest version), please help!
I also tried installing:
statsmodels
fastcluster
And also tried downgrading matplotlib but didn't work
import seaborn
seaborn.heatmap(Data_Set7)
Error:
File "<ipython-input-13-0336b4e3860e>", line 1, in <module>
seaborn.heatmap(Data_Set7)
AttributeError: module 'seaborn' has no attribute 'heatmap'
I'm using Tensorflow 2.0 but getting error while executing train.py.
from tensorflow.contrib.memory_stats.python.ops.memory_stats_ops import BytesInUse
ModuleNotFoundError: No module named 'tensorflow.contrib'
can anyone please help me with finding tf.contrib module in tensorflow2.0
tensorflow.contrib is being removed in version 2.0, you therefore need version <= 1.14 to operate tflearn (by the way, this is a TFlearn issue, not a tensorflow one). (source)
About OC: Ubuntu 16.04 LTS x86_64; GRX CUDA 10.2; cudnn ... etc.
TF: 2.1.0; Python 3.6
About the problem:
When I launch module_main.py an error is displayed. When I launch it /legacy/train.py similarly, an error appears.
Is it possible to fix this problem without downgrading the tensorflow version and without reinstalling the drivers?
Is changing the code via a script the only way?
Logs below:
model_main.py
Traceback (most resent call last):
File "models/research/object_detection/model_main.py",
line 26, in <module> from object_detection import model_lib
File "/root/ObjectDetection/models/research/object_detection/model_lib.py"
line 27, in <module> from object_detection import eval_lib
File "/root/ObjectDetection/models/research/object_detection/eval_util.py",
line 40, in <module> slim = tf.contrib.slim
AttributeError: module 'tensorflow' has no attribute 'contrib'
Also using conda env
thx, for some advice
I faced the same issue. Tensorflow 2.0 has removed tf.contrib. I tried to fixed the error by changing the code. And it lead to many other error.
I fixed this issue by downgrading tensorflow to 1.14.0
Run these commands on terminal:
pip uninstall tensorflow
pip install tensorflow==1.14.0
I have been trying to use tensorflow to build a simple neural network using PyCharm. I have managed to install the tensorflow package(see image below) but the following error appears when I try to run the application.
Traceback (most recent call last): File "C:/Users/abc/Desktop/new-app/neuraln.py", line 1, in
import tensorflow as tf ModuleNotFoundError: No module named 'tensorflow'
I would really appreciate some help. Thanks!
Note - I'm not using conda env