hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

ValueError: not enough values to unpack (expected 5, got 0) #482

Closed lwxGitHub123 closed 1 year ago

lwxGitHub123 commented 1 year ago

Hi everyone , i try to convert yolov4.weights to yolov4.tflite ; when i run this command: python3 save_model.py --weights /home/liudongbo/yolo/tensorflow-yolov4-tflite/data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4 --framework tflite --score_thres 0.2

it returns like this:

2023-04-11 11:24:12.065731: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory 2023-04-11 11:24:12.065758: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. 2023-04-11 11:24:13.081875: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/liudongbo/.local/lib/python3.8/site-packages/cv2/../../lib64: 2023-04-11 11:24:13.081902: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303) 2023-04-11 11:24:13.081922: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (szcompile1.senarytech.com): /proc/driver/nvidia/version does not exist 2023-04-11 11:24:13.082199: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-04-11 11:24:13.126426: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2200000000 Hz 2023-04-11 11:24:13.135788: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0xff2260 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2023-04-11 11:24:13.135842: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version weights_file =
/home/liudongbo/yolo/tensorflow-yolov4-tflite/data/yolov4.weights Traceback (most recent call last): File "save_model.py", line 58, in app.run(main) File "/home/liudongbo/.local/lib/python3.8/site-packages/absl/app.py", line 308, in run _run_main(main, args) File "/home/liudongbo/.local/lib/python3.8/site-packages/absl/app.py", line 254, in _run_main sys.exit(main(argv)) File "save_model.py", line 54, in main save_tf() File "save_model.py", line 49, in save_tf utils.load_weights(model, FLAGS.weights, FLAGS.model, FLAGS.tiny) File "/home/liudongbo/yolo/tensorflow-yolov4-tflite/core/utils.py", line 39, in loadweights major, minor, revision, seen, = np.fromfile(wf, dtype=np.int32, count=5) ValueError: not enough values to unpack (expected 5, got 0)

What's wrong with it ? anybody help me please ?