allanzelener / YAD2K

YAD2K: Yet Another Darknet 2 Keras
Other
2.72k stars 881 forks source link

In Quick Start. #46

Open nicezic opened 7 years ago

nicezic commented 7 years ago

System : Ubuntu 16.04 Install : python 3.5 and using alternative to set 3.5 is default. -> update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1 Install ( global ) : pip install -user packages...

In Quick Start. ./yad2k.py yolo.cfg yolo.weights model_data/yolo.h5 -> well done.

However,

./test_yolo.py model_data/yolo.h5

Using TensorFlow backend. 2017-06-19 10:41:16.146412: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-19 10:41:16.146543: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-19 10:41:16.146612: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-06-19 10:41:16.146673: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-06-19 10:41:16.146731: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. Traceback (most recent call last): File "./test_yolo.py", line 194, in _main(parser.parse_args()) File "./test_yolo.py", line 79, in _main yolo_model = load_model(model_path) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/models.py", line 246, in load_model model = model_from_config(model_config, custom_objects=custom_objects) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/models.py", line 314, in model_from_config return layer_module.deserialize(config, custom_objects=custom_objects) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/layers/init.py", line 54, in deserialize printable_module_name='layer') File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object list(custom_objects.items()))) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/engine/topology.py", line 2450, in from_config process_layer(layer_data) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/engine/topology.py", line 2419, in process_layer custom_objects=custom_objects) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/layers/init.py", line 54, in deserialize printable_module_name='layer') File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/utils/generic_utils.py", line 142, in deserialize_keras_object return cls.from_config(config['config']) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/engine/topology.py", line 1242, in from_config return cls(**config) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/layers/advanced_activations.py", line 38, in init self.alpha = K.cast_to_floatx(alpha) File "/home/ubuntu/.local/lib/python3.5/site-packages/keras/backend/common.py", line 108, in cast_to_floatx return np.asarray(x, dtype=_FLOATX) File "/home/ubuntu/.local/lib/python3.5/site-packages/numpy/core/numeric.py", line 531, in asarray return array(a, dtype, copy=False, order=order) TypeError: float() argument must be a string or a number, not 'dict'

I got this... Any idea, please?

shenzhun commented 7 years ago

I met the same error.

ni9elf commented 7 years ago

The code is not compatible with Keras 2.0.5 Works fine with: Keras 2.0.4 Python: 3.5.2 Tensorflow: 1.2.0

Downgrade Keras using: pip3 install keras==2.0.4

agjayant commented 7 years ago

Got the same error and this hack here worked : https://github.com/fchollet/keras/issues/7107