Hello, I have tried to compile keras model in tvm. I have done it many times before it worked fine. But today when I did it , I got error like this:
021-10-08 19:05:34.658145: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library ‘libcudart.so.11.0’; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2021-10-08 19:05:34.658197: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File “from_keras.py”, line 43, in
import keras
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/keras/init.py”, line 21, in
from tensorflow.python import tf2
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/init.py”, line 41, in
from tensorflow.python.tools import module_util as _module_util
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/init.py”, line 49, in
from tensorflow.python.feature_column import feature_column_lib as feature_column
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/feature_column/feature_column_lib.py”, line 22, in
from tensorflow.python.feature_column.feature_column import *
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/feature_column/feature_column.py”, line 147, in
from tensorflow.python.layers import base
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/layers/base.py”, line 20, in
from tensorflow.python.keras.legacy_tf_layers import base
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/init.py”, line 25, in
from tensorflow.python.keras import models
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/models.py”, line 20, in
from tensorflow.python.keras import metrics as metrics_module
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/metrics.py”, line 34, in
from tensorflow.python.keras import activations
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/activations.py”, line 18, in
from tensorflow.python.keras.layers import advanced_activations
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/layers/init.py”, line 29, in
from tensorflow.python.keras.layers.preprocessing.image_preprocessing import CenterCrop
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/layers/preprocessing/image_preprocessing.py”, line 29, in
from tensorflow.python.keras.preprocessing import image as image_preprocessing
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/preprocessing/init.py”, line 22, in
from tensorflow.python.keras.preprocessing import image
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/tensorflow/python/keras/preprocessing/image.py”, line 20, in
from keras_preprocessing import image
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/keras_preprocessing/image.py”, line 18, in
backend = get_keras_submodule(‘backend’)
File “/home/udeshkohli18/.local/lib/python3.8/site-packages/keras_preprocessing/init.py”, line 24, in get_keras_submodule
raise ImportError('You need to first import keras
’
ImportError: You need to first import keras
in order to use keras_preprocessing
. For instance, you can do:
import keras
from keras_preprocessing import image
Or, preferably, this equivalent formulation:
from keras import preprocessing
____________________________________________________
Even though there are import statement , I am getting this error. Can anyone help me in solving this issue.
Thanks in advance.