Git Product home page Git Product logo

keras-yolov4's Introduction

简体中文 | English

miemie2013

个人介绍

好康的照骗比枯燥乏味的文字更具有说服力↓

Example 0

Example 0

Example 0

友情链接

  • miemieGAN miemieGAN是咩酱个人开发与维护的图像生成库,以咩酱的名字命名,实现了stylegan2ada等算法,目前文档完善中,欢迎大家试玩。

传送门

算法1群:645796480(人已满)

算法2群:894642886

粉丝群:704991252

关于仓库的疑问尽量在Issues上提,避免重复解答。

B站不定时女装: _糖蜜

知乎不定时谢邀、写文章: 咩咩2013

西瓜视频: 咩咩2013

微信:wer186259

本人微信公众号:miemie_2013

技术博客:https://blog.csdn.net/qq_27311165

AIStudio主页:asasasaaawws

欢迎在GitHub或上面的平台关注我(求粉)~

打赏

如果你觉得我的仓库对你很有帮助,可以给我打钱↓

Example 0

咩酱爱你哟!

keras-yolov4's People

Contributors

miemie2013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keras-yolov4's Issues

有关于自定义coco格式数据集进行训练的问题

您好,请问一下,在tools下的cocotools.py文件中的clsid2catid和catid2clsid两个字典代表什么?
我在使用自己定义的coco标注格式的数据集进行训练时遇到以下的报错,看起来像是因为数据信息造成的。

我的环境是这样的:
操作系统 Ubuntu 18.04
gcc版本 7.5.0
tensorflow 1.14
keras 2.2.5
cuda 10.1
cudnn 7.6.5

然后,我制作的coco数据集有四类标签,catid分别是1,2,3,4。

loading annotations into memory...
Done (t=0.14s)
creating index...
index created!
Traceback (most recent call last):
File "train.py", line 248, in
train_dataset, train_img_ids, _catid2clsid, cfg.train_pre_path)
File "/home/mortal/ETOP/Document_Layout_Analysis/keras_yolov4/tools/data_process.py", line 60, in data_clean
gt_class[i][0] = catid2clsid[catid]
KeyError: 4

anchor尺寸问题

大神,你好,请问config.py中的anchor尺寸是相对于原始图像大小(如(h,w)),还是实际进入模型的图像大小(如[608,608]呢?非常感谢

模型转keras出现EOF错误?

模型转keras出现EOF错误
可否能够提供一个可执行的keras预训练模型?

并且,在从头训练时,11G 1080ti,size 608时 batch 最高只能为2 ,否则显存溢出,这是为什么?
ps:显卡运行良好

Error while trying to train a model for a new dataset

Hey

I am having the following error when I try to train a new model for the voc dataset!!!
Any idea how to solve this ?

Traceback (most recent call last):
File "train.py", line 273, in
model_body.load_weights(cfg.model_path, by_name=True, skip_mismatch=True)
File ".........conda\envs\tflow_coco\lib\site-packages\keras\engine\saving.py", line 458, in load_wrapper
return load_function(*args, **kwargs)
File ".........conda\envs\tflow_coco\lib\site-packages\keras\engine\network.py", line 1214, in load_weights
reshape=reshape)
File ".........conda\envs\tflow_coco\lib\site-packages\keras\engine\saving.py", line 1245, in load_weights_from_hdf5_group_by_name
g = f[name]
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "C:\Users\merwan.birem.conda\envs\tflow_coco\lib\site-packages\h5py_hl\group.py", line 264, in getitem
oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'tf_op_layer_split' doesn't exist)"

Thank you

Merwan

demo.py

博主好,yolov4.pt转keras,h5已转成功,现在检测其效果,当我运行demo.py时出现以下错误:
Traceback (most recent call last):
File "demo_fast.py", line 137, in
outs = yolo.predict(pimage)
File "/home/anaconda3/lib/python3.6/site-packages/keras/engine/training.py", line 1462, in predict
callbacks=callbacks)
File "/home/anaconda3/lib/python3.6/site-packages/keras/engine/training_arrays.py", line 324, in predict_loop
batch_outs = f(ins_batch)
File "/home/.local/lib/python3.6/site-packages/tensorflow/python/keras/backend.py", line 3076, in call
run_metadata=self.run_metadata)
File "/home/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1439, in call
run_metadata_ptr)
File "/home/.local/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node conv2d_1/convolution}}]]
[[{{node lambda_1/Reshape_24}}]]

请问这是怎么回事?怎么解决 ?

小白求问个细节问题

在yolo_model.py 里,为啥有
grid_h, grid_w, num_boxes = map(int, out.shape[1: 4])

按我的理解,out的尺寸应该是(13x13为例):[13, 13, 3, 85],如果要输出网格的长宽、bbox数量的话,那不应该是:out.shape[0:3] 吗?

Using keras custom trained model In video?

Hi, I am a noob in computer vision. I was able to follow the author and train my custom dataset in yolov4 Keras. The final map value is great and its accuracy in images is great as well. But how to apply detection in video files?
Can anyone provide me some insight?

判断最佳模型的条件,以及设置停止条件

您好,我最近用您这个做了一个简单的检测箱子的模型,开始5000次保存的模型感觉效果还行,就一直训练着,现在训练到46000次,发现模型效果反而变得很差,查看日志,损失函数期间从降低一直到再次升高,但最终损失函数还是蛮小的,不知道有没有一个比较好的参考值,比如说mAP达到多少,我的任务相对简单,评测mAP大的时候有0.68的样子;后续一直训练,最终最佳模型mAP能达到0.8的样子,实际效果却很不理想了

從新訓練model遇到問題

我在重新訓練model時遇到以下列問題:
在每5000步要eval集的mAP時遇到
Loading and preparing results...
Traceback (most recent call last):
File "train.py", line 420, in
box_ap = eval(_decode, val_images, cfg.val_pre_path, cfg.val_path, cfg.eval_batch_size, _clsid2catid, cfg.draw_image)
File "/home/Keras-YOLOv4/tools/cocotools.py", line 164, in eval
box_ap_stats = bbox_eval(anno_file)
File "/home/Keras-YOLOv4/tools/cocotools.py", line 92, in bbox_eval
map_stats = cocoapi_eval(outfile, 'bbox', coco_gt=coco_gt)
File "/home/Keras-YOLOv4/tools/cocotools.py", line 62, in cocoapi_eval
coco_dt = coco_gt.loadRes(jsonfile)
File "/usr/local/lib/python3.6/dist-packages/pycocotools/coco.py", line 326, in loadRes
if 'caption' in anns[0]:
IndexError: list index out of range

請問有人有相同問題嗎?

如何将 yolov4_2x.h5、ppyolo_2x.h5和ppyolo_r18vd.h5权重文件保存成完整的图?

以上3个文件用netron打开看只有权重,在demo.py中加载后用 predict_model.save("yolov4_2x_all.h5") 报错如下

Traceback (most recent call last):
  File "demo.py", line 102, in <module>
    predict_model.save("yolov4_2x_all.h5"); print("###END"); time.sleep(1000)      ### error
  File "/data/zhou.zhou/project_envs/P31_jieqin/lib/python3.6/site-packages/keras/engine/network.py", line 1139, in save
    save_model(self, filepath, overwrite, include_optimizer)
  File "/data/zhou.zhou/project_envs/P31_jieqin/lib/python3.6/site-packages/keras/engine/saving.py", line 415, in save_wrapper
    save_function(obj, filepath, overwrite, *args, **kwargs)
  File "/data/zhou.zhou/project_envs/P31_jieqin/lib/python3.6/site-packages/keras/engine/saving.py", line 507, in save_model
    _serialize_model(model, h5dict, include_optimizer)
  File "/data/zhou.zhou/project_envs/P31_jieqin/lib/python3.6/site-packages/keras/engine/saving.py", line 100, in _serialize_model
    model_config['config'] = model.get_config()
  File "/data/zhou.zhou/project_envs/P31_jieqin/lib/python3.6/site-packages/keras/engine/network.py", line 937, in get_config
    return copy.deepcopy(config)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 215, in _deepcopy_list
    append(deepcopy(a, memo))
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 220, in _deepcopy_tuple
    y = [deepcopy(a, memo) for a in x]
  File "/usr/local/lib/python3.6/copy.py", line 220, in <listcomp>
    y = [deepcopy(a, memo) for a in x]
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 220, in _deepcopy_tuple
    y = [deepcopy(a, memo) for a in x]
  File "/usr/local/lib/python3.6/copy.py", line 220, in <listcomp>
    y = [deepcopy(a, memo) for a in x]
  File "/usr/local/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/local/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/local/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/lib/python3.6/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/local/lib/python3.6/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/local/lib/python3.6/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/usr/local/lib/python3.6/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/lib/python3.6/copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: can't pickle _thread.RLock objects

请问下,如何将权重保存为完整的图,谢谢!

关于anchor 的设置?

我的数据集中目标普遍偏小,是用默认的anchor,还是自己用kmeans从新聚类?

聚类出来的结果是[11, 24],[12, 11], [15, 23], [16, 40], [25 , 16][28, 58],[44, 24], [59,113], [102, 44]

目前我是使用了聚类的结果,但是效果很差。
所以想请教你一下

多线程调用模型进行测试

ValueError: Tensor Tensor("lambda_1/map/TensorArrayStack/TensorArrayGatherV3:0", shape=(?, ?, 6), dtype=float32) is not an element of this graph.

当我使用一下代码进行测试的时候出现这个错误,
hat_cfg = PPYOLO_2x_Config()
hat_detector = PPYOLO_2x_Hat(hat_cfg, use_gpu=True)
video_path = cfg.video_path

def main():
# ----------------------------------------视频处理------------------------------------------
cap = cv2.VideoCapture(video_path)
print('load ' + video_path)
print('---------------------------')
index = 0
while True:
print(index)
ret, frame = cap.read()
if not ret:
break
if index % cfg.sample_interval != 0:
index += 1
continue
_, hat_output_box = hat_detector.detect_image(frame) # 安全帽检测
print(hat_output_box)
index+=1

if name == 'main':
for i in range(3):
threading.Thread(target=main).start()

多gpu训练

不知道有没有人使用过多gpu训练并成功?我这边好像不行

Resource exhausted

NVIDIA GEFORCE RTX 2060 6GB+cuda10.0,运行过程中会出现资源耗尽的错误,请问是什么原因呢?

tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[8,64,256,256] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[{{node mish_4/mul}}]]

Loss error

loading annotations into memory...
Done (t=0.02s)
creating index...
index created!
2020-08-03 10:24:10,579-INFO: 2501 samples in train set.
WARNING:tensorflow:Output yolo_loss_1 missing from loss dictionary. We assume this was done on purpose. The fit and evaluate APIs will not be expecting any data to be passed to yolo_loss_1.
2020-08-03 10:24:10,604-WARNING: Output yolo_loss_1 missing from loss dictionary. We assume this was done on purpose. The fit and evaluate APIs will not be expecting any data to be passed to yolo_loss_1.
WARNING:tensorflow:Output yolo_loss_2 missing from loss dictionary. We assume this was done on purpose. The fit and evaluate APIs will not be expecting any data to be passed to yolo_loss_2.
2020-08-03 10:24:10,604-WARNING: Output yolo_loss_2 missing from loss dictionary. We assume this was done on purpose. The fit and evaluate APIs will not be expecting any data to be passed to yolo_loss_2.
Traceback (most recent call last):
File "C:\Users\AI Lord.conda\envs\pytorch_lib\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1619, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index -1 of dimension 0 out of bounds. for 'loss/yolo_loss_loss/strided_slice' (op: 'StridedSlice') with input shapes: [0], [1], [1], [1] and with computed input tensors: input[1] = <-1>, input[2] = <0>, input[3] = <1>.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:/Yolov4_资料/yolov4_test/train.py", line 360, in
model.compile(loss={'yolo_loss': lambda y_true, y_pred: y_pred}, optimizer=Adam(lr=cfg.lr))

请问这个错误怎么解决?不是很明白. 谢谢

训练只使用cpu

请问有遇到训练自己的数据没有调用gpu的情况吗,我自训练结果在使用cpu。没有自动去使用gpu

推理时的速度如何?

我用实验室服务器的单张tesla T4跑qqwwee那版keras的YOLO V3,速度才十几fps,比作者原版代码>30fps的速度慢很多
我看了下YOLO V4 的网络层比起YOLO V3更多更复杂,加入了很多tricks,输入还从416变成608,这样速度还能增加吗?
请问你实现的这版keras的YOLO V4,在你的环境下,推理速度能达到多少呢?能达到相同环境下作者原代码速度的多少?

out of memory

i have a 1060 card with 6G memory, it seems it always give me error when train it. i set up batch = 1, 416x416.

what could be wrong? any idea?

单机多卡应该怎么操作

model = keras.models.Model([model_body.input, *y_true], loss_list) parallel_model = multi_gpu_model(model, 2)
添加了multi_gpu_model,将后面所有model换成parallel_model,在保存模型的时候用model.save,但是不起作用,还是只是一张卡

ValueError: slice index -1 of dimension 0 out of bounds. 错误

在运行train.py时,模型能成功导入,但是yolo_loss处则出现报错,如下:

Traceback (most recent call last):
File "train.py", line 370, in
model.compile(loss={"yolo_loss": lambda y_true, y_pred: y_pred}, optimizer=keras.optimizers.Adam(lr=cfg.lr))
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 446, in compile
self._compile_weights_loss_and_weighted_metrics()
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 1592, in _compile_weights_loss_and_weighted_metrics
self.total_loss = self._prepare_total_loss(masks)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 1652, in _prepare_total_loss
per_sample_losses = loss_fn.call(y_true, y_pred)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/keras/losses.py", line 220, in call
y_pred, y_true)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/ops/losses/util.py", line 79, in squeeze_or_expand_dimensions
is_last_dim_1 = math_ops.equal(1, array_ops.shape(y_pred)[-1])
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/ops/array_ops.py", line 898, in _slice_helper
name=name)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/ops/array_ops.py", line 1064, in strided_slice
shrink_axis_mask=shrink_axis_mask)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_array_ops.py", line 9535, in strided_slice
shrink_axis_mask=shrink_axis_mask, name=name)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/framework/op_def_library.py", line 742, in _apply_op_helper
attrs=attr_protos, op_def=op_def)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3322, in _create_op_internal
op_def=op_def)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1786, in init
control_input_ops)
File "/home/ma-user/anaconda3/envs/TensorFlow-2.1.0/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1622, in _create_c_op
raise ValueError(str(e))
ValueError: slice index -1 of dimension 0 out of bounds. for 'loss/yolo_loss_loss/strided_slice' (op: 'StridedSlice') with input shapes: [0], [1], [1], [1] and with computed input tensors: input[1] = <-1>, input[2] = <0>, input[3] = <1>.

使用的是自制数据集。另外,keras模块全部是使用tensorflow内的keras submodule。百度了下还是没法子。谢谢

widerface数据集上训练了15000次,测试ap全是-1.00

Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = -1.000
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
2020-06-21 21:31:47,448-INFO: box ap: -1.000
2020-06-21 21:31:47,448-INFO: Best test ap: 0.0, in iter: 0
2020-06-21 21:31:54,487-INFO: Train iter: 85020, all_loss: 1.343320, ciou_loss: 0.422198, conf_loss: 0.921049, prob_loss: 0.000073, eta: 99 days, 14:04:02
2020-06-21 21:32:01,028-INFO: Train iter: 85040, all_loss: 23.520687, ciou_loss: 9.526450, conf_loss: 13.994050, prob_loss: 0.000187, eta: 2 days, 17:30:05
2020-06-21 21:32:08,001-INFO: Train iter: 85060, all_loss: 0.913662, ciou_loss: 0.542059, conf_loss: 0.371578, prob_loss: 0.000024, eta: 2 days, 20:36:34

MemoryError

2020-06-21 20:08:35,249-INFO: Test iter 5800
loading annotations into memory...
Done (t=0.06s)
creating index...
index created!
2020-06-21 20:09:15,991-INFO: Generating json file...
Traceback (most recent call last):
File "eval.py", line 72, in
box_ap = eval(_decode, images, eval_pre_path, anno_file, eval_batch_size, _clsid2catid, draw_image)
File "E:\chongqingchuyuxiangmu\Keras-YOLOv4\tools\cocotools.py", line 167, in eval
box_ap_stats = bbox_eval(anno_file)
File "E:\chongqingchuyuxiangmu\Keras-YOLOv4\tools\cocotools.py", line 86, in bbox_eval
for line in f:
MemoryError
运行test_dev.py正常,但运行eval.py程序之后,出现MemoryError,请问是怎么回事?

数据增强代码BUG

class BboxXYXY2XYWH(BaseOperator):
"""
Convert bbox XYXY format to XYWH format.
"""

def __init__(self):
    super(BboxXYXY2XYWH, self).__init__()

def __call__(self, sample, context=None):
    assert 'gt_bbox' in sample
    bbox = sample['gt_bbox']
    bbox[:, 2:4] = bbox[:, 2:4] - bbox[:, :2]
    bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2.
    sample['gt_bbox'] = bbox
    return sample

bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2. 这一部分代码是变成 中心点,应该是有误的吧  不需要它

多GPU训练遇到的问题

请问这个训练可以使用多GPU训练吗?我单独GPU可以,但是多个就不行了,错误如下。不知道是我这边代码的问题还是yolo4还没有实现多GPU训练
image

Yolo4 for action(3d) input

能不能实现一个接受动作输入的yolo4, 就是一个序列图片作为输入,检查视频里人的动作的种类的yolo4. 现有的yolo4都是2d的输入,现在要输入3d的数据。

map

你好,我想知道作者的yolov4网络在voc2007上能达到多少,还有您的能达到多少呢

input size修改

請問我如果要修改model的input size是只要修改config.py理的input_shape就好嗎?
另外如果我想要train單通道的圖片該怎麼做修改

yolo_loss的问题

在开始训练后出现了一个问题,在输出损失的时候提示
File ".\train.py", line 402, in
iter_id, losses[0], losses[0], losses[1], losses[2], losses[3], eta)
IndexError: list index out of range
查看losses的形状时,发现只是一个长度为2的数组
而yolo_loss输出的是长度为3的数组
不知道哪里出了问题,大佬可以看一下吗
(之前尝试过改成all_loss = losses[0]+losses[1]+losses[2]还是不行)

能否将Resize操作写成层

想要将预处理中的Resize写成层,放在Input后面。

# 自定义Resize层
class Resizing(tf.keras.layers.Layer):
    def __init__(self, target_size, method=tf.image.ResizeMethod.BILINEAR, **kwargs):
        super().__init__(**kwargs)
        
        self.target_size = target_size
        self.method = method 
    
    def __call__(self, inputs):
        return tf.image.resize(inputs, size=self.target_size, method=self.method)
    
    def compute_output_shape(self, input_shape):
        return (self.target_size[0], self.target_size[1], input_shape[-1])

# build model
cfg = YOLOv4_2x_Config()
cfg.head["drop_block"] = False

backbone = CSPDarknet53(**cfg.backbone)
head = YOLOv4Head(yolo_loss=None, nms_cfg=cfg.nms_cfg, **cfg.head)
yolo = YOLO(backbone, head)

x = keras.layers.Input(shape=(None, None, 3), name="x", dtype="float32")
xp = Resizing(target_size=(608,608), name="resize")(x)
im_size = keras.layers.Input(shape=(2,), name="im_size", dtype="int32")
outputs = yolo.get_outputs(xp)
preds = yolo.get_prediction(outputs, im_size)

model = keras.models.Model(inputs=[x, im_size], outputs=preds)

在yolov4_head里面做拼接时,卷积得到的featuremap的size是None,x不是None,二者无法Concat
https://github.com/miemie2013/Keras-YOLOv4/blob/master/model/yolov4_head.py#169

请教下有没有什么解决思路

请问是否可以将darknet-tiny-yolov4的weights文件转换成.h5?

我尝试执行convert.py转换darknet的yolov4-tiny weights,输出如下:

Weights Header:  0 2 5 [1280000]
Converting  0
Converting  1
Converting  2
Converting  3
Converting  4
Converting  5
Converting  6
Converting  7
Converting  8
Converting  9
Converting  10
Converting  11
Converting  12
Converting  13
Converting  14
Converting  15
Converting  16
Converting  17
Converting  18
Converting  19
Converting  20
Converting  21
Converting  22
Converting  23
Converting  24
Converting  25
Converting  26
Converting  27
Converting  28
Converting  29
Converting  30
Converting  31
Converting  32
Converting  33
Converting  34
Converting  35
Converting  36
Converting  37
Converting  38
Converting  39
Converting  40
Converting  41
Converting  42
Converting  43
Converting  44
Converting  45
Converting  46
Converting  47
Converting  48
Traceback (most recent call last):
  File "convert.py", line 173, in <module>
    yolo4_model = Yolo4(score, iou, anchors_path, classes_path, model_path, weights_path)
  File "convert.py", line 157, in __init__
    self.load_yolo()
  File "convert.py", line 130, in load_yolo
    buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.