Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow Import Error (compat.py_: AttributeError: 'module' object has no attribute 'integer'

I am trying to use tensorflow for a research project, but I am unable to import it into my program even though I successfully installed it using Anaconda. I am using a Mac 10.13.5. Whenever I try to import tensorflow, I keep receiving this error: AttributeError: 'module' object has no attribute 'integer' in the tensorflow file compat.py. The error is at line 129 of this file:

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/util/compat.py

at the line: "integral_types = (_numbers.Integral, _np.integer)"

Can anyone help me resolve this so that I can use tensorflow? Thank you.

like image 890
arnavlohe15 Avatar asked Jun 23 '26 11:06

arnavlohe15


1 Answers

I did encountered that problem also. I tried re-installing numpy with pip install -U --force-reinstall numpy and things worked. Hope it works for you too.

like image 98
Le-Vu Tran Avatar answered Jun 25 '26 10:06

Le-Vu Tran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!