qqwweee / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

larrytsai0515 opened this issue · comments

@luvWY Hello, I have some problems running the yolo_video.py program. The problem is as follows:
Traceback (most recent call last):
File "yolo_video.py", line 106, in
detect_video(YOLO(**vars(FLAGS)), FLAGS.input, FLAGS.output)
File "C:\Users\GenkiTek\Desktop\people_count_keras\people_count_keras\people_count_keras\keras-yolo3\yolo.py", line 90, in init
self.boxes, self.scores, self.classes = self.generate()
File "C:\Users\GenkiTek\Desktop\people_count_keras\people_count_keras\people_count_keras\keras-yolo3\yolo.py", line 123, in generate
self.yolo_model.load_weights(self.model_path) # make sure model, anchors and classes match
File "C:\Users\GenkiTek\anaconda3\envs\py37\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "C:\Users\GenkiTek\anaconda3\envs\py37\lib\site-packages\keras\engine\network.py", line 1230, in load_weights
f, self.layers, reshape=reshape)
File "C:\Users\GenkiTek\anaconda3\envs\py37\lib\site-packages\keras\engine\saving.py", line 1183, in load_weights_from_hdf5_group
original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
what is the problem

the problem related with h5py. Downgrade your h5py.
pip install 'h5py==2.10.0' --force-reinstall

Hey guys, I've run all the quick start commands and I'm now at the training section
Am I to just,

  1. Run python voc_annotation.py (I have no custom datasets)
    2.And then run python convert.py -w yolov3.cfg yolov3.weights model_data/yolo_weights.h5
  2. And then finally run train.py? Is this going to work please?