qqwweee / keras-yolo3

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

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

Open larrytsai0515 opened 2 years ago

larrytsai0515 commented 2 years ago

@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

RGuven commented 2 years ago

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

btopii32 commented 1 year ago

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?