qqwweee / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend)
MIT License
7.14k stars 3.45k forks source link

Error when run yolo.py #59

Open Sakuralala opened 6 years ago

Sakuralala commented 6 years ago

Hi, when I run the code as the README.MD suggested,at the step of "python yolo.py",I got an error:TypeError: float() argument must be a string or a number, not 'dict'?Is there a way I can solve it?Thanks.

qqwweee commented 6 years ago

It is wired. Check the traceback to see where the error occurs. By the way, this repo is on Python3. If you are on Python2, error occurs somewhere.

Sakuralala commented 6 years ago

I use python3,and here is my running environment: python 3 + keras-gpu 2.15 +tensorflow-gpu 1.7 As for the traceback: Traceback (most recent call last): File "yolo.py", line 194, in detect_img(YOLO()) File "yolo.py", line 33, in init self.boxes, self.scores, self.classes = self.generate() File "yolo.py", line 54, in generate self.yolo_model = load_model(model_path, compile=False) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/models.py", line 243, in load_model model = model_from_config(model_config, custom_objects=custom_objects) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/models.py", line 317, in model_from_config return layer_module.deserialize(config, custom_objects=custom_objects) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/layers/init.py", line 55, in deserialize printable_module_name='layer') File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 144, in deserialize_keras_object list(custom_objects.items()))) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/engine/topology.py", line 2514, in from_config process_layer(layer_data) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/engine/topology.py", line 2500, in process_layer custom_objects=custom_objects) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/layers/init.py", line 55, in deserialize printable_module_name='layer') File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 146, in deserialize_keras_object return cls.from_config(config['config']) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/engine/topology.py", line 1271, in from_config return cls(**config) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/layers/advanced_activations.py", line 43, in init self.alpha = K.cast_to_floatx(alpha) File "/root/anaconda2/envs/3dpy3/lib/python3.6/site-packages/keras/backend/common.py", line 110, in cast_to_floatx return np.asarray(x, dtype=_FLOATX) File "/root/anaconda2/envs/3dpy3/lib/python3.6/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' Because I'm new in using keras,so I'm not sure what error happened yet...Can you help me ?Thanks!

qqwweee commented 6 years ago

Perhaps something wrong with your environment, even if the version seems OK.

zhlw2017 commented 6 years ago

hello!when i run the yolo.py as the README.MD suggested,I got the Error :AttributeError:module ‘tensorflow.python.ops.nn’ has no attribute 'leaky_relu'. I don't know how to solve it,the environment is

Python 3.6
Keras 2.1.6
tensorflow 1.2.1
zhlw2017 commented 6 years ago

额,问题已经解决了。 the error is killed,and the code is very good。

gittigxuy commented 6 years ago

@zhlw2017 ,怎么解决的呢?我的系统是ubuntu14.04,因此不能使用tf>=1.5,我的环境是

Python 3.6 Keras 2.1.5 tensorflow 1.3.0 请问一下如何解决的?可否加我QQ:1262485779交流一下,谢谢了