$ make train MODEL=yolo_mobilev1 DEPTHMUL=0.75 MAXEP=10
ILR=0.001 DATASET=voc CLSNUM=20 IAA=False BATCH=8
python ./keras_train.py \
--train_set voc \
--class_num 20 \
--pre_ckpt "" \
--model_def yolo_mobilev1 \
--depth_multiplier 0.75 \
--augmenter False \
--image_size 224 320 \
--output_size 7 10 14 20 \
--batch_size 32 \
--rand_seed 3 \
--max_nrof_epochs 10 \
--init_learning_rate 0.0005 \
--learning_rate_decay_factor 0 \
--obj_weight 1 \
--noobj_weight 1 \
--wh_weight 1 \
--obj_thresh 0.7 \
--iou_thresh 0.5 \
--vaildation_split 0.05 \
--log_dir log \
--is_prune False \
--prune_initial_sparsity 0.5 \
--prune_final_sparsity 0.9 \
--prune_end_epoch 5 \
--prune_frequency 100
WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
* https://github.com/tensorflow/addons
* https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.
2022-03-15 16:21:52.145631: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2022-03-15 16:21:52.167418: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2096875000 Hz
2022-03-15 16:21:52.168281: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5643bd94b6a0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2022-03-15 16:21:52.168352: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2022-03-15 16:21:52.169885: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2022-03-15 16:21:52.169909: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2022-03-15 16:21:52.169922: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (xx): /proc/driver/nvidia/version does not exist
[ INFO ] data augment is False
WARNING:tensorflow:From /home/kearney/.conda/envs/k210/lib/python3.7/site-packages/tensorflow_core/python/data/util/random_seed.py:58: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
[ INFO ] data augment is False
WARNING:tensorflow:From /home/kearney/.conda/envs/k210/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
File "./keras_train.py", line 155, in <module>
args.prune_frequency)
File "./keras_train.py", line 51, in main
yolo_model, yolo_model_warpper = network([image_size[0], image_size[1], 3], len(h.anchors[0]), class_num, alpha=depth_multiplier)
File "/home/kearney/Downloads/k210/Yolo-for-k210/Yolo-for-k210/models/yolonet.py", line 19, in yolo_mobilev1
base_model.load_weights('data/mobilenet_v1_base_7.h5')
File "/home/kearney/.conda/envs/k210/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 182, in load_weights
return super(Model, self).load_weights(filepath, by_name)
File "/home/kearney/.conda/envs/k210/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 1373, in load_weights
saving.load_weights_from_hdf5_group(f, self.layers)
File "/home/kearney/.conda/envs/k210/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 645, in load_weights_from_hdf5_group
original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode'
make: *** [Makefile:35:train] 错误 1
模型训练-v1.pdf
报错误
解决办法来自 成功解决AttributeError: ‘str‘ object has no attribute ‘decode‘
猜测是作者 pip freeze 的时候删除了很多东西,我 pip 出来有好多个包,如下所示