I am working on my laptop with tensorflow 2.4.1 and keras 2.3.1 in an anaconda virtual environment. Unfortunately I need to run my code on a remote machine, but I am having tons of problems in setting up a working virtual environment there. I even tried to export my working venv on my laptop there via a myenv.yml file without success. When I try to import keras in my code using myenv on my virtual machine I run into the error 'ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context'
, that I do not get on my laptop with the same venv.
I know I can use from tensorflow import keras (I have already tried and it worked) but my problem is that I need to import hyperas (specifically, I need to 'from hyperas import optim' ) and this line keeps throwing the same 'ImportError: cannot import name 'get_config' from 'tensorflow.python.eager.context'
error.
I have tried upgrading tensorflow via conda install -c conda-forge tensorflow
, but it doesn't solve the environment. I have tried creating new environments and manually installing keras, tensorflow etc but I keep running in the same problem.
What can I do?