molimat / YOLOv4-Counter-in-TF

An implementation of a tracker using yolov4, tf and sort_tracker. (still in development)
MIT License
24 stars 12 forks source link

detectvideo_counter.py #2

Open byq-luo opened 4 years ago

byq-luo commented 4 years ago

Traceback (most recent call last): File "detect.py", line 104, in app.run(main) File "D:\ProgramData\Anaconda3\envs\yolov4\lib\site-packages\absl\app.py", line 299, in run _run_main(main, args) File "D:\ProgramData\Anaconda3\envs\yolov4\lib\site-packages\absl\app.py", line 250, in _run_main sys.exit(main(argv)) File "detect.py", line 70, in main utils.load_weights(model, FLAGS.weights) File "C:\Users\Administrator\Downloads\Compressed\YOLOv4-Counter-in-TF-master\core\utils.py", line 123, in load_weights assert len(wf.read()) == 0, 'failed to read all data' AssertionError: failed to read all data

molimat commented 4 years ago

Sorry for this delayed answer. I just updated the core files and corrected all files that weren`t work. Now the yolo tiny has been implemented as well. Let me know if it working now.

byq-luo commented 4 years ago

Sorry for this delayed answer. I just updated the core files and corrected all files that weren`t work. Now the yolo tiny has been implemented as well. Let me know if it working now.

It did not work, still the same error.

molimat commented 4 years ago

here is working fine

python detect.py --weights ./checkpoints/yolov4-tiny-416 --image ./data/madureira.jpg --tiny

this weights are previous converted from tiny weights in darknet github

to convert the weights you can use something like

python save_model.py --weights ./checkpoints/yolov4-tiny.weights --output ./checkpoints/yolov4-tiny-416 --input_size 416 --model yolov4 --tiny

byq-luo commented 4 years ago

here is working fine

python detect.py --weights ./checkpoints/yolov4-tiny-416 --image ./data/madureira.jpg --tiny

this weights are previous converted from tiny weights in darknet github

to convert the weights you can use something like

python save_model.py --weights ./checkpoints/yolov4-tiny.weights --output ./checkpoints/yolov4-tiny-416 --input_size 416 --model yolov4 --tiny

Traceback (most recent call last): File "save_model.py", line 55, in app.run(main) File "D:\ProgramData\Anaconda3\envs\yolov4\lib\site-packages\absl\app.py", line 299, in run _run_main(main, args) File "D:\ProgramData\Anaconda3\envs\yolov4\lib\site-packages\absl\app.py", line 250, in _run_main sys.exit(main(argv)) File "save_model.py", line 51, in main save_tf() File "save_model.py", line 24, in save_tf utils.load_weights_tiny(model, FLAGS.weights) File "C:\Users\Administrator\Downloads\Compressed\YOLOv4-Counter-in-TF-master\core\utils.py", line 37, in load_weights_tiny conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 4482926 into shape (1024,512,3,3) (yolov4) PS C:\Users\Administrator\Downloads\Compressed\YOLOv4-Counter-in-TF-master>

MilersWang commented 2 years ago

here is working fine python detect.py --weights ./checkpoints/yolov4-tiny-416 --image ./data/madureira.jpg --tiny this weights are previous converted from tiny weights in darknet github to convert the weights you can use something like python save_model.py --weights ./checkpoints/yolov4-tiny.weights --output ./checkpoints/yolov4-tiny-416 --input_size 416 --model yolov4 --tiny

Traceback (most recent call last): File "save_model.py", line 55, in app.run(main) File "D:\ProgramData\Anaconda3\envs\yolov4\lib\site-packages\absl\app.py", line 299, in run _run_main(main, args) File "D:\ProgramData\Anaconda3\envs\yolov4\lib\site-packages\absl\app.py", line 250, in _run_main sys.exit(main(argv)) File "save_model.py", line 51, in main save_tf() File "save_model.py", line 24, in save_tf utils.load_weights_tiny(model, FLAGS.weights) File "C:\Users\Administrator\Downloads\Compressed\YOLOv4-Counter-in-TF-master\core\utils.py", line 37, in load_weights_tiny conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 4482926 into shape (1024,512,3,3) (yolov4) PS C:\Users\Administrator\Downloads\Compressed\YOLOv4-Counter-in-TF-master>

This can slove the problem!! https://github.com/theAIGuysCode/yolov4-deepsort/issues/73