Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with Tensorflow package when it's used by Lucid package

So I am trying to use the code in this link:

https://colab.research.google.com/github/tensorflow/lucid/blob/master/notebooks/differentiable-parameterizations/style_transfer_2d.ipynb#scrollTo=FsFc1mE51tCd

it's giving some errors when Lucid is trying to use Tensorflow at the first part where it tries to import. I tried to install some different Tensorflow versions and some different Lucid versions but still could not get it working.

Here are some of errors I get:

when I try

from lucid.modelzoo import vision_models

I get this

 /usr/local/lib/python3.6/dist-packages/lucid/misc/io/reading.py in <module>()
 31 from urllib.parse import urlparse, urljoin
 32 from future.moves.urllib import request
 33 from tensorflow import gfile
 34 from tempfile import gettempdir
 35 from io import BytesIO, StringIO

 ImportError: cannot import name 'gfile'

when I try:

 import lucid.optvis.param as param

I get this error:

/usr/local/lib/python3.6/dist-packages/lucid/optvis/param/cppn.py in <module>()
 19 import numpy as np
 20 import tensorflow as tf
 21 from tensorflow.contrib import slim
 22 
 23 

 ModuleNotFoundError: No module named 'tensorflow.contrib'
like image 692
Data_eng Avatar asked Apr 14 '20 23:04

Data_eng


1 Answers

As for today, lucid does not work with tensorflow2.0 and later versions. However, you can use tf1.15 or any older version and this should solve it.

like image 190
Data_sniffer Avatar answered Nov 15 '22 20:11

Data_sniffer