AIWintermuteAI/aXeleRate

Issue installing

Closed this issue · 7 comments

Hi
Just tried a fresh install on a new VM (Ubuntu Desktop 16.04.6 64-bit), followed instructions but when I tried running tests_training.py I get the following error:
ModuleNotFoundError: No module named 'tensorflow.keras.layers.experimental.preprocessing'
...
ImportError: Keras requires Tensorflow 2.2 or higher.

Obviously a dependency issue...just not sure which has the wrong version... TF or Keras??

Any suggestions?
Thanks
Tim

Hello!
How are you installing aXeleRate? From pip install aXeleRate or pip install git+https://github.com/AIWintermuteAI/aXeleRate ?
Either way it is really strange... I cannot find any code containing tensorflow.keras.layers.experimental.preprocessing --- and I don't remember adding it, because I am yet to update aXeleRate to tf.keras.
Screenshot from 2020-06-24 12-01-16

Hi
I did the following:
pip install git+https://github.com/AIWintermuteAI/aXeleRate
Followed by:
git clone https://github.com/AIWintermuteAI/aXeleRate.git
Then
python tests_training.com

Yeah it had me confused too as it is a new, clean environment.

Cheers
Tim

Just checked the versions that the pip install installed:

  • keras: 2.4.2
  • tensorflow: 1.15.3

I noticed an error when I try to update keras (InvalidArchiveError("Error with archive /home/.... Message from libarchive was: Failed to crate dir 'lib/python3.7/site-packages/tensorflow/python/profiler" So I deleted that conda env and created a new one.
This time it used keras 2.4.3 and TF 1.15.3

Same error when trying to run tests_training.com.

Then I tried conda install "keras<=2.3.2" - (which seemed to do nothing more than update tensorflow-base-2.2.0) but when I do conda list I still see keras: 2.4.3 (very strange)

I tried running tests_training.py again.. and it got a bit further, got error:

python tests_training.py
Using TensorFlow backend.
Traceback (most recent call last):
  File "tests_training.py", line 2, in <module>
    from axelerate import setup_training, setup_inference
  File "/home/tim/Dev/ML/aXeleRate/axelerate/__init__.py", line 1, in <module>
    from .train import setup_training
  File "/home/tim/Dev/ML/aXeleRate/axelerate/train.py", line 19, in <module>
    gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5)
AttributeError: module 'tensorflow' has no attribute 'GPUOptions'

Any suggestions?
Any idea what is different between your environment and mine? I specifically created this new environment so I could use the same as you.

Thanks again
Tim.

The issue was in Keras package update. I was under the impression that 2.3.1 is going to be last standalone keras version. But turned out that I was wrong and 2.4.0 was released a few days ago, which is only compatible with tf 2.0.
I changed the requirements for keras from keras >= 2.3.1 to keras == 2.3.1 in this commit
947eef3
Please try creating a fresh environment and installing again - btw if you use GPU it is better to install tensorflow-gpu package from conda, it will automatically install cuda/cudnn as well if you haven't done that already.
Anyways, check the latest commit and see if it resolves the problem :)

Thanks for this.
Just recreated my conda environment. keras now with 2.3.1 and TF 1.15.3.

When running tests_training I get an error regarding the target folder (/home/ubuntu/...etc) so need to modify hard coded paths in tests_training.py then it works!

Many thanks for your work and assistance with this - much appreciated!
Tim

From the config dictionary inside tests_training.py
"saved_folder": "/home/ubuntu/space safety/classifier",

"saved_folder": "/home/ubuntu/space safety/classifier",

"saved_folder": "/home/ubuntu/space safety/detector",

"saved_folder": "/home/ubuntu/space safety/segment",

I'll correct that in the next release, thank you for noticing this nonsense :)
Just correct them to something like "results/name-for-project-folder" for now.

My pleasure!