Tensorflow V2.1.0 and Numpy compatibility - numpy

I installed tensorflow v2.1.0. The Jupyter notebook on my Mac showed lots of warnings already when I just imported tensorflow. See the screenshot below:
How do I fix the compatibility issue?

Related

Colab SpaCy | PyTorch NameError: name '_C' is not defined

Trying to import spacy into Google Colab but getting an error name '_C' is not defined. Is it problem with the torch somewhere inside?
torch version: 1.13.1
spacy version: 3.5.0
I've tried to upgrade spacy and cython, but it didn't work. What should I do?
As I said I've tried solutions from here, here and here
When I'm trying to downgrade numpy I'm getting a dependency error with scipy.
I've also tried to install torch 1.9.0 as in here but it also didn't work.
And I've tried to downgrade to spacy 3.4.3 which runs perfectly on my local machine -- didn't work.
UPD: just discovered that importing torch shows same error
UPD_2: this happened when I've uploaded my own notebook. When I open a new clear notebook -- everything works just fine.

Are there problems with Tensorflow and Keras in Mac version 12.2 (OS Monterey)

I bought a new Mac version 12.2 (OS Monterey) and installed Anaconda. Most of the Python packages can be installed correctly. However, Tensorflow (ver 2.8.0) and Keras (ver 2.8.0) have major issues. The Jupyter notebook kernel gets killed when tensorflow and/or keras get imported. I looked up various posts on Stackoverflow and Medium, however, nothing seems helpful. I even tried to convert the .ipynb to .py script, however, the same error occurs.
Is there anything that can be done to resolve this?

simply importing tensorflow kills my Jupiter notebook kernel

As described in jypyter notebook I tried:
import tensorflow
then my kernel is killed, like "The kernel appears to have died. It will restart automatically."
Tried to reinstall anaconda, numpy, tensorflow, didn't work.
well I also experienced this normally this can't work because tensorflow is too big for jupyter notebook though you may try downloading the anaconda navigator if you don't have it already though this may not work

Tensorflow not working on Python 3.7, Mac OS, and Pycharm

Attempting to run tensorflow a Mac, using python 3.7 as well as PyCharm and receiving where module tensorflow has no attribute app, at the following.
I've run through a number of potential solutions. Following the instructions provided on this question: Installing tensorflow on Pycharm (Mac). I've managed to successfully create a virtual-env in which I installed the tensorflow package however this folder contains
nothing but the init.py and pycache and the error remains.
I've also tried copying the contents of the tensorflow GitHub repo directly into this folder but it results in an ImportError.
Not sure what the issue is. Should I switch to python 2.7?
Python 3.7 is still unsupported as of this moment by tensorflow.

Failed to import 'tensorflow.contrib.tensorrt' in tensorflow r1.14

I have installed the Tensorflow r1.14 and want to use TF-TRT. However, the following error occurs:
"ModuleNotFoundError: No module named 'tensorflow.contrib.tensorrt'"
when running the sample code. The same error occurs with Tensorflow r1.13. So my question is do I need to install the tensorflow.contrib.tensorrt library separately? If yes, how?
Additionally, I can run the sample code of the TensorRT, e.g. sampleINT8, successfully. Click here to see my successful sample code run.
This leads me to believe that TensorRT is installed properly. However, the TF-TRT still doesn't work.
Any help would be greatly appreciated!
In TF 1.14, TF-TRT was moved to the core from contrib.
You need to import it like this: from tensorflow.python.compiler.tensorrt import > trt_convert as trt
https://github.com/tensorflow/tensorrt/blob/master/tftrt/examples/image-classification/image_classification.py#L22
This is the correct answer for Linux.
However, if you're using Windows: the TensorRT Python API (and therefore TF-TRT) is not supported for Windows at the moment, so the TensorFlow python packages aren't built with TensorRT.
In TF 1.14, TF-TRT was moved to the core from contrib.
You need to import it like this:
from tensorflow.python.compiler.tensorrt import trt_convert as trt
https://github.com/tensorflow/tensorrt/blob/master/tftrt/examples/image-classification/image_classification.py#L22
In order to be able to import tensorflow.contrib.tensorrt you need to have tensorflow-gpu version >= 1.7 installed on your system. Maybe you could try installing the tensorflow-gpu library with a:
pip install tensorflow-gpu
Check out the Windows section of the GPU documentation as well. Also, I would try updating your tensorflow version with a:
pip install --upgrade tensorflow
to ensure you're up to date there as well. Check out this section of the TensorFlow documentation for additional support.
Hopefully that helps!
2 possibilities
Have you installed tensorflow-gpu instead of tensorflow?
From your screenshot it looks like you're using Windows. I had the same problem. There seems no tensorrt module under contrib in TF windows distribution however linux has it (I tried 1.13.1).