ssd_head_keras icon indicating copy to clipboard operation
ssd_head_keras copied to clipboard

You may want to update the documentation

Open Shamino0 opened this issue 4 years ago • 0 comments

I'm starting to experiment with this code and discovered some incompatibilities with modern Linux distributions that you may want to address.

  1. Because it relies on TensorFlow 1.x, it is incompatible with Python 3.8 and later. Ubuntu 20.04 ships with Python 3.8 and 3.9, and has no support for earlier versions. I worked around this by installing Ubuntu 18.04 (with its Python 3.6) in a VM. I assume I could also manually install Python 3.6 on a more recent Linux distribution as well.
  2. I followed the Readme file to install prerequisite packages. The latest versions of pip, virtualenv, numpy, jupyterlab, matplotlib and h5py. Then tensorflow 1.14 and keras 2.2.4. Running the jupyter notebook's instructions with this configuration caused numpy to produce a lot of deprecated function warnings:
.../venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type,  (1,)) / '(1,)type'. 
   _np_qint8 = np.dtype([("qint8", np.int8, 1)])

I worked around this by downgrading numpy to version 1.16.4 (the version in your requirements.txt file).

  1. After that, in steps 1.2 and 1.3 (build/load the model), I got errors from Keras:
.../venv/lib/python3.6/site-packages/keras/engine/saving.py in _deserialize_model(f, custom_objects, compile) 
    222     if model_config is None:
    223         raise ValueError('No model found in config.')
--> 224     model_config = json.loads(model_config.decode('utf-8'))
    225     model = model_from_config(model_config, custom_objects=custom_objects)
    226     model_weights_group = f['model_weights']

AttributeError: 'str' object has no attribute 'decode'

Upgrading tensorflow to version 1.15.5 (different from the version in the Readme file) fixed this.

I would therefore suggest that the quick-start instructions include these revisions. Something like:

pip3 install virtualenv numpy==1.16.4 jupyterlab matplotlib h5py tensorflow==1.15.5 keras==2.2.4

Along with a statement that Python version 3.7 or older is required.

Shamino0 avatar Feb 03 '21 17:02 Shamino0