I get illegal instruction (core dumped) after running import tensorflow with version of tensorflow 1.7.
After that I installed tf 1.5.0-gpu (pip3 install --upgrade tensorflow-gpu==1.5.0)
Then tried to import tensorflow, I get no error
However tf.set_random_seed(random_state) - returns AttributeError: module 'tensorflow' has no attribute 'set_random_seed'
Then in the jupyter notebook with shit-tab get library help:
Type: module
String form: <module 'tensorflow' (namespace)>
Docstring: <no docstring>
Seems to isnt righ. However :
~ $ pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.5.0
Summary: TensorFlow helps the tensors flow
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: /home/analyst/anaconda3/lib/python3.6/site-packages
Requires: absl-py, wheel, six, tensorflow-tensorboard, numpy, protobuf
Required-by:
$ pip show tensorflow #Returns nothing
What might be wrong?
UPD: I have such files, which can be found via search. Im afraid of 1.1.0 tf. Is it okay?
>qqusr#qqusr-PC ~ $ locate -i tensorflow.py
/home/qqusr/anaconda3/pkgs/tensorflow-1.1.0-np112py36_0/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py
/home/qqusr/tensorflow/tensorflow/tools/dist_test/scripts/k8s_tensorflow.py
upd: I have 2 active namaspaces: how to fix that:
> tf.__path__
_NamespacePath(['/home/aa/tensorflow', '/home/aa/anaconda3/lib/python3.6/site-packages/tensorflow'])
1) One method that worked for #JaeDukSeo was using the precomplied version
https://www.lfd.uci.edu/~gohlke/pythonlibs/#tensorflow
In addition you give this a try and for precomplied GPU version: https://github.com/mind/wheels.
2) However, installing precomputed version leads me to another error, problems with intel libraries. Trying to solve such problem I found the solution
conda install -c anaconda tensorflow-gpu
You can specify here version you want to install as well
Related
I was trying to download imageai using pip module and I got following error:
ERROR: tensorflow-intel 2.11.0 has requirement keras<2.12,>=2.11.0, but you'll have keras 2.4.3 which is incompatible.
ERROR: tensorflow-intel 2.11.0 has requirement numpy>=1.20, but you'll have numpy 1.19.3 which is incompatible.
I don't know what to do. Please help.
The error message you are seeing indicates that the current version of TensorFlow that you have installed (tensorflow-intel 2.11.0) requires different versions of Keras and Numpy than the versions that are currently installed on your system. Specifically, tensorflow-intel 2.11.0 requires Keras version less than 2.12 but you have version 2.4.3 installed, and it also requires Numpy version greater than or equal to 1.20, but you have version 1.19.3 installed.
You could try upgrading Keras and Numpy to meet these requirements:
pip install keras==2.11.0
pip install numpy>=1.20
I installed imageai,tensorflow,keras in python with pip
i typed this code
from imageai.Detection import ObjectDetection
it shows this error
ModuleNotFoundError: No module named 'keras.layers.advanced_activations'
module versions
imageai - 2.0.2
keras - 2.90
tensorflow - 2.9.1
im running on windows 10 pro
Try to update version of imageai to new versions.
try this
As imageai now uses Pytorch in backend, you must install a few library dependencies before installing imageai. Please refer to this link for the same.
pip install cython pillow>=7.0.0 numpy>=1.18.1 opencv-python>=4.1.2 torch>=1.9.0 --extra-index-url https://download.pytorch.org/whl/cpu torchvision>=0.10.0 --extra-index-url https://download.pytorch.org/whl/cpu pytest==7.1.3 tqdm==4.64.1 scipy>=1.7.3 matplotlib>=3.4.3 mock==4.0.3
pip install imageai --upgrade
Import the Object detection api from imageai
from imageai.Detection import ObjectDetection
Let us know if the issue still persists. Thank you.
On my machine i can't "pip install torch" - i get infamous "single source externally managed error" - i could not fix it and used "conda install torch" from anaconda.
Still, checking version is easy - torch.__version__
But how to see where is it installed -the home dir of torch?
Suppose if I had had both torches installed via pip and conda - how to know which one is used in a project?
import torch
print(torch__version__)
You can get torch module location which is imported in your script
import torch
print(torch.__file__)
pip show torch at terminal will give you all the required information.
Name: torch
Version: 1.3.1
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages#pytorch.org
License: BSD-3
Location: c:\programdata\anaconda3\lib\site-packages
Requires: numpy
Required-by: torchvision, torchtext, efficientunet-pytorch
If you have already installed PyTorch library, then open Google Colab, paste following code and hit the run button:
import torch
print(torch.__file__)
then you see version of PyTorch.
If it is not working then please go to https://pytorch.org/get-started/locally/ and follow the instruction about how to install PyTorch because sometimes Python and PyTorch have dependencies issues.
I am trying to install tensorflow for one of my machine learning projects. However, even though I have installed it, I still get this error
ModuleNotFoundError: No module named 'tensorflow'
To help illustrate this better, I have created a test.py file, with the following content:
import tensorflow as tf
print('Hello world!')
However, still the same error, on line 1.
Relevant questions:
I've tried doing many other answers, but none of them seems to help. Any answers would be appreciated.
Here's some debugging outputs that might help:
pip3 show tensorflow
Name: tensorflow
Version: 1.11.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: c:\program files\anaconda3\lib\site-packages
Requires: absl-py, termcolor, keras-applications, astor, six, tensorboard, keras-preprocessing, wheel, gast, setuptools, grpcio, protobuf, numpy
Required-by:
pip3 --version
pip 18.1 from c:\program files\anaconda3\lib\site-packages\pip (python 3.6)
python --version
Python 3.6.0 :: Anaconda 4.3.0 (64-bit)
py test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
I fixed it! Special thanks to the folks at the Tensorflow Talk slack who helped me, especially #akofman.
It was a combination of 2 problems:
Problem 1
It seems that one of the reasons it was failing was due to one of tensorflow's dependencies being outdated/misinstalled/something. The dependency is h5py. I found out about this by attempting to run import tensorflow in the python interpreter (type python), which gave me a long stack trace, unlike the test file (see problem 2). I fixed this by reinstalling the dependency.
Problem 2
It turns out that I have 3, that's right, 3!, versions of python on my computer
python -V ---> 3.6.0
python -V (in an anaconda enviorment) ---> 3.6.7
py -V ---> 3.7.0
I was running my test file with py, which is apparently 3.7.0 (I thought it was synonymous with python), I guess tensorflow doesn't support that version?
I have been following the installation guide from http://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/
I got & am using:
conda 4.3.22
Python 3.5.3 :: Anaconda 4.4.0 (32-bit)
scipy: 0.19.0
numpy: 1.12.1
matplotlib: 2.0.2
pandas: 0.20.1
statsmodels: 0.8.0
sklearn: 0.18.2
I successfully installed theano & keras. HOWEVER, I FAIL at installing tensorflow. Please HELP.
I created a conda ‘tensorflow’ environment with python 3.5. With command
『pip install –ignore-installed –upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp35-cp35m-win_amd64.whl』
I got ERROR saying
『tensorflow-1.2.1-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform』
So i changed to version 1.0.1 and same error.
Version 1.1.0 also same error.
So i deactivated the environment, and type command
『conda install -c conda-forge tensorflow』
I got ERROR
『PackageNotFoundError: Package missing in current win-32 channels』
Instead it says the close match found is “xtensor” which i know is a C++ library that I'm not looking for.
Is it because I’m using a 32-bit Windows 10?
So I also tried running the following :
『python -m pip install –upgrade tensorflow』
and got ERROR of
『Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow』
What more requirements do i need for this?
I tried 『pip3 install tensorflow』 but somehow it could not recognized ‘pip3’. So i type 『where pip3』 and it could not find files for the given pattern. So i type『where python』. It ouput the directory of my python. Then checked if it’s already put under the path inside the environmental variable. And it has. But i still couldn't use pip3 command.
I have tried all the solutions provided from people having similar problem with me and none of them work.
This question has been answered here.
In short, yes, TensorFlow does not support 32-bit platforms. Although if you only plan on writing abstract high-level Keras code then Theano will do just fine.