Error Running colab: "!convert-darknet-weights yolov4.weights -o yolov4.h5"
BakhtawarRehman opened this issue · comments
Hi, I am having error running colab notebook. I tried to run on another instance but it did not work either,
Error raised while converting .weight to .h5:
"!convert-darknet-weights yolov4.weights -o yolov4.h5"
Error:
2020-08-05 10:23:48.397401: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1 2020-08-05 10:23:48.447336: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:48.448105: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:00:04.0 name: Tesla K80 computeCapability: 3.7 coreClock: 0.8235GHz coreCount: 13 deviceMemorySize: 11.17GiB deviceMemoryBandwidth: 223.96GiB/s 2020-08-05 10:23:48.448420: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2020-08-05 10:23:48.720643: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10 2020-08-05 10:23:48.857943: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10 2020-08-05 10:23:48.879975: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10 2020-08-05 10:23:49.188024: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10 2020-08-05 10:23:49.225123: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10 2020-08-05 10:23:49.789556: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2020-08-05 10:23:49.789774: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.790641: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.791392: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0 2020-08-05 10:23:49.791845: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2020-08-05 10:23:49.799011: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2200000000 Hz 2020-08-05 10:23:49.799288: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x27b0bc0 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2020-08-05 10:23:49.799322: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version 2020-08-05 10:23:49.886345: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.887205: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x27b0d80 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices: 2020-08-05 10:23:49.887274: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Tesla K80, Compute Capability 3.7 2020-08-05 10:23:49.888592: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.889296: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1561] Found device 0 with properties: pciBusID: 0000:00:04.0 name: Tesla K80 computeCapability: 3.7 coreClock: 0.8235GHz coreCount: 13 deviceMemorySize: 11.17GiB deviceMemoryBandwidth: 223.96GiB/s 2020-08-05 10:23:49.889360: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2020-08-05 10:23:49.889395: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10 2020-08-05 10:23:49.889444: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10 2020-08-05 10:23:49.889522: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10 2020-08-05 10:23:49.889558: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10 2020-08-05 10:23:49.889587: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10 2020-08-05 10:23:49.889618: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2020-08-05 10:23:49.889698: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.890401: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.891066: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1703] Adding visible gpu devices: 0 2020-08-05 10:23:49.891133: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1 2020-08-05 10:23:49.897215: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-08-05 10:23:49.897263: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1108] 0 2020-08-05 10:23:49.897305: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1121] 0: N 2020-08-05 10:23:49.897485: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.898322: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-08-05 10:23:49.899023: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0. 2020-08-05 10:23:49.899085: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1247] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10691 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:00:04.0, compute capability: 3.7) Download original Darknet weights 257196032/261095424 [============================>.] - ETA: 0sConverting original Darknet weights to .h5 format Traceback (most recent call last): File "/usr/local/bin/convert-darknet-weights", line 8, in <module> sys.exit(convert_darknet_weights()) File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/tf2_yolov4/tools/convert_darknet_weights.py", line 41, in convert_darknet_weights input_shape=INPUT_SHAPE, num_classes=num_classes, anchors=YOLOV4_ANCHORS File "/usr/local/lib/python3.6/dist-packages/tf2_yolov4/model.py", line 80, in YOLOv4 yolov4.load_weights(weights_path, by_name=True, skip_mismatch=True) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 250, in load_weights return super(Model, self).load_weights(filepath, by_name, skip_mismatch) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/network.py", line 1227, in load_weights if _is_hdf5_filepath(filepath): File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/network.py", line 1616, in _is_hdf5_filepath return (filepath.endswith('.h5') or filepath.endswith('.keras') or AttributeError: 'PosixPath' object has no attribute 'endswith' ls: cannot access './yolov4.h5': No such file or directory
got the same error on local (Ubuntu 18.04, python 3.6.8, Tensorflow 2.2.0) and on Colab.
Hi @BakhtawarRehman @sammilei, thanks for raising this. PR is on the way to be merged and should fix the problem
Hi any updates on weight conversion