letsdoitworld / wade-ai

an AI algorithm for detecting trash in geolocated images

Home Page:https://www.trashai.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

shaye059 opened this issue · comments

The Python modules seem to be written for TensorFlow 1 and many of the methods are no longer supported. If anyone else is running TensorFlow 2.0 or newer and gets this issue run the following in command prompt within the Trash_Detection directory:

tf_upgrade_v2 --intree mrcnn --inplace

This will update the python files so that they are compatible with the newer version of TensorFlow. Alternatively, you can downgrade to TensorFlow version 1.13.1 and keras 2.1.0

If you are running TensorFlow 2.3 (or even 2.* I think) , there's a method below may also solve the problem.

apply config=tf.compat.v1.ConfigProto() instead of config = tf.ConfigProto()

Hi,
I want to install the wade-ai on a raspbery pi and I am thinking to use django. Probably I won't need Jupiter notebook so I will run everything into my project (WIP)

What I did

  1. I exported from Jupiter Notebook into a python file
  2. I did tf_upgrade_v2 --intree mrcnn --inplace to update mrcnn code for TensorFlow 2.
  3. But when I run it I get

ValueError: Tried to convert 'shape' to a tensor and failed. Error: None values not supported.

Can you help me with a pip freeze just to know I have the right versions of the packages?

Here is my pip freeze:

absl-py (0.11.0)
alabaster (0.7.12)
appnope (0.1.2)
argon2-cffi (20.1.0)
astor (0.8.1)
astunparse (1.6.3)
async-generator (1.10)
attrs (20.3.0)
Babel (2.9.0)
backcall (0.2.0)
bleach (3.2.1)
cached-property (1.5.2)
cachetools (4.2.0)
certifi (2020.12.5)
cffi (1.14.4)
chardet (3.0.4)
cycler (0.10.0)
Cython (0.29.21)
decorator (4.4.2)
defusedxml (0.6.0)
docutils (0.16)
entrypoints (0.3)
flatbuffers (1.12)
gast (0.3.3)
google-auth (1.24.0)
google-auth-oauthlib (0.4.2)
google-pasta (0.2.0)
grpcio (1.32.0)
h5py (3.1.0)
idna (2.10)
imageio (2.9.0)
imagesize (1.2.0)
imgaug (0.4.0)
importlib-metadata (3.3.0)
ipykernel (5.4.2)
ipyparallel (6.3.0)
ipython (7.16.1)
ipython-genutils (0.2.0)
ipywidgets (7.5.1)
jedi (0.17.2)
Jinja2 (2.11.2)
jsonschema (3.2.0)
jupyter-client (6.1.7)
jupyter-core (4.7.0)
jupyterlab-pygments (0.1.2)
Keras (2.4.0)
Keras-Applications (1.0.8)
Keras-Preprocessing (1.1.2)
kiwisolver (1.3.1)
Markdown (3.3.3)
MarkupSafe (1.1.1)
matplotlib (3.3.3)
mistune (0.8.4)
nbclient (0.5.1)
nbconvert (6.0.7)
nbformat (5.0.8)
nest-asyncio (1.4.3)
networkx (2.5)
nose (1.3.7)
notebook (6.1.5)
numpy (1.19.4)
oauthlib (3.1.0)
opencv-python (4.4.0.46)
opt-einsum (3.3.0)
packaging (20.8)
pandocfilters (1.4.3)
parso (0.7.1)
pexpect (4.8.0)
pickleshare (0.7.5)
Pillow (8.0.1)
pip (9.0.1)
prometheus-client (0.9.0)
prompt-toolkit (3.0.8)
protobuf (3.14.0)
ptyprocess (0.6.0)
pyasn1 (0.4.8)
pyasn1-modules (0.2.8)
pycparser (2.20)
Pygments (2.7.3)
pyparsing (2.4.7)
pyrsistent (0.17.3)
python-dateutil (2.8.1)
pytz (2020.4)
PyWavelets (1.1.1)
PyYAML (5.3.1)
pyzmq (20.0.0)
qtconsole (5.0.1)
QtPy (1.9.0)
requests (2.25.0)
requests-oauthlib (1.3.0)
rsa (4.6)
scikit-image (0.17.2)
scipy (1.5.4)
Send2Trash (1.5.0)
setuptools (51.0.0)
Shapely (1.7.1)
six (1.15.0)
snowballstemmer (2.0.0)
Sphinx (3.3.1)
sphinxcontrib-applehelp (1.0.2)
sphinxcontrib-devhelp (1.0.2)
sphinxcontrib-htmlhelp (1.0.3)
sphinxcontrib-jsmath (1.0.1)
sphinxcontrib-qthelp (1.0.3)
sphinxcontrib-serializinghtml (1.1.4)
tensorboard (2.4.0)
tensorboard-plugin-wit (1.7.0)
tensorflow (2.4.0)
tensorflow-estimator (2.4.0)
tensorflow-gpu (1.1.0)
termcolor (1.1.0)
terminado (0.9.1)
testpath (0.4.4)
tifffile (2020.9.3)
tornado (6.1)
traitlets (4.3.3)
typing-extensions (3.7.4.3)
urllib3 (1.26.2)
wcwidth (0.2.5)
webencodings (0.5.1)
Werkzeug (1.0.1)
wheel (0.36.2)
widgetsnbextension (3.5.1)
wrapt (1.12.1)
zipp (3.4.0)

Hi
For those who still have difficulty running the notebook, create a venv with python3.6.13 and tensorflow 1.13.1.