AttributeError:'tensorflow.python.framework.fast_tensor_util' has no attribute 'appendfloat32arraytotensorproto' - tensorflow

TensorFlow 2.2.0 + Keras 2.3.1 on Python 3.7
How to fix this AttributeError? I reinstall the TensorFlow but it does not work.

I had an exact same issue with Python 3.5.6 :: Anaconda, Inc. but I don't think it's Python's or TF version fault.
Frankly speaking, decided to create a new py-env like this (given that I use conda distro):
Created this env.yml file:
name: tf2
channels:
- defaults
- anaconda
dependencies:
- jupyter
- matplotlib
- numpy
- python=3.7
- scikit-learn
- tensorflow
then ran
conda env create -f env.yml
conda activate tf2
python -m ipykernel install --user --name=tf2
jupyter notebook
and it all works:

Related

Error when installing TensorFlow through pip

I'm following the instructions from https://www.tensorflow.org/install/pip#python-version-support to install tensorflow. I've used tensorflow before but for some reason, it has just stopped working. I'm using VS Code.
First, I check that pip and python are compatible:
python3 --version
python3 -m pip --version
I have Python 3.10.8, with pip 22.3.1 so it should be compatible. Then, I create a conda environment and activate it:
conda create --name tf python=3.9
conda activate tf
However, now when I try
pip install tensorflow
I get the error
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
How can I fix this? I also tried things in the past like installing tensorflow through Conda, but I get errors when importing tensorflow there.
Could you please try again by opening anaconda cmd propmt and run below code:
conda create --name tf_new python=3.10
conda activate tf_new
then install tensorflow using:
pip install tensorflow
Now open the VS code by selecting the same created VirEnv tf_new from Anaconda navigator.
In VScode, Open a new jupyter notebook file and run the below code by selecting the tf_new (Conda VirEnv) in kernel(from top right) .
import tensorflow as tf
tf.__version__
Output:
'2.11.0'

Tensorboard: TensorFlow installation not found

I am trying to use tensorboard but i got the following error: TensorFlow installation not found - running with reduced feature set.
i've tried to follow those step: tensorboard: command not found but it didn't help me (even when i do cd tensorboard and python main.py i still have this error)
Tensorboard will be automatically installed along with Tensorflow.
#create virtual environment
python -m venv --system-site-packages .\venv
#Activate env
.\venv\Scripts\activate
#Install Tensorflow
pip install tensorflow
#verify the installation: show packages installed within the virtual environment
pip list
Output
tensorboard 2.5.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
tensorflow 2.5.0
tensorflow-datasets 4.0.1
tensorflow-estimator 2.5.0

tensorflow import issue for python 3.7

After installing tensorflow for python 3.7, I tried to import it but it gave me a syntax error.
the command used for installation :
sudo -H pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.0-py3-none-any.whl
I don't think tensorflow has supported python3.7 yet. Is there a way to fix it?
enter image description here
You can solve this by simply changing the name of all these (Ctrl + R and Replace All) from async to for example async1 as also this post suggests.
But even after fixing it you will probably encounter other problems with Tensorflow and Python 3.7.0 . For more details see my answer here: Does TensorFlow 1.9 support Python 3.7
tensorflow import for python 3.7
for Anaconda 2019.03 with Python 3.7 version
for CPU
create command:
conda create -n tensorflow_env tensorflow
activate command:
conda activate tensorflow_env
Import command:
(tensorflow_env) C:\WINDOWS\system32>python
import tensorflow as tf
print(tf.version)
for GPU
create command:
conda create -n tensorflow_gpuenv tensorflow-gpu
activate command:
conda activate tensorflow_gpuenv
Import command:
(tensorflow_gpuenv) C:\WINDOWS\system32>python
import tensorflow as tf
print(tf.version)

tensorflow is only available in virtual env in anaconda

I installed tensorflow-gpu in anaconda3.
The steps I followed are:
conda create -n tensorflow pip python=3.6
source activate tensorflow
pip install tensorflow_gpu-1.8.0-cp36-cp36m-linux_x86_64.whl
After these steps, I find that if I use the python and ipython in anaconda3/bin, I can't import tensorflow (no module named tensorflow)
But If I activate the environment of tensorflow or I use the python and ipython in anaconda3/env/tensorflow/bin, I can import tensorflow.
And there is also no directory for tensorflow inanaconda3/lib/python3.6/site-package
Anyone knows why?
You created a conda environment and installed Tensorflow to that environment. Therefore you can only use Tensorflow inside that environment.
If you wish to use Tensorflow outside of an environment then don't activate the environment you created and just pip install Tensorflow.

tensorflow installation error in Window + anaconda

i tried to install tensorflow in my anaconda by creating a virtual env
conda create -n tensorflow python=3.5
but after i type y, nothing happened. How can i fix this?
So what you did is creating an environment called tensorflow, you need to install it as well
you can do either
conda install tensorflow
or
pip install tensorflow