kongqi404 / yolov3_fake_refactor

将qqwweee大佬的yolov3的keras实现做了一丢丢改动来适应tf2.0
MIT License
2 stars 1 forks source link

在win10的tf2.1版本下运行train.py会报错,具体信息如下: #1

Open monoloxo opened 4 years ago

monoloxo commented 4 years ago

Load weights model_data/yolo_weights.h5. Freeze the first 249 layers of total 252 layers. Traceback (most recent call last): File "train.py", line 203, in _main() File "train.py", line 46, in _main freeze_body=2, weights_path='model_data/yolo_weights.h5') # make sure you know what you freeze File "train.py", line 143, in create_model [model_body.output, y_true]) File "C:\Users\diaoc.conda\envs\tf21\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 773, in call outputs = call_fn(cast_inputs, args, kwargs) File "C:\Users\diaoc.conda\envs\tf21\lib\site-packages\tensorflow_core\python\keras\layers\core.py", line 846, in call result = self.function(inputs, kwargs) File "C:\Users\diaoc\tf20\yolov3_fake_refactor\yolo3\model.py", line 412, in yololoss , ignore_mask = K.control_flow_ops.while_loop(lambda b,args: b<m, loop_body, [0, ignore_mask])

AttributeError: module 'tensorflow.keras.backend' has no attribute 'control_flow_ops'

但是源文件是可以在backend.py下找到from tensorflow.python.ops import control_flow_ops的。

monoloxo commented 4 years ago

已处理,重新下载train.py覆盖

您好,还是报的一样的错,(然后我用文件差异对比软件发现两个train.py没有差异,不过也有可能我替换时搞混了,所以这个情况请忽视),不过又再次下载了train.py,替换后还是同样的错误。

kongqi404 commented 4 years ago

当时上传时忘记更新model.py 现已更新 tf2.x将while_loop 转移到了tf.while_loop

monoloxo commented 4 years ago

当时上传时忘记更新model.py 现已更新 tf2.x将while_loop 转移到了tf.while_loop

您好,我怕是windows的原因,所以又在Ubuntu 上tf2.0跑了一下,之前的问题应该解决了; 现在的情况是我用的voc数据集,基于darknet53.conv.74转成的darknet53_weights.h5进行训练,错误信息如下: 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>. 没搜索到什么有用的信息,又来打扰您了

kongqi404 commented 4 years ago

voc数据集我没在这上面跑过,你可以写一个py脚本将voc的xml转为所要求的train.txt然后试试

kevinzhou26 commented 4 years ago

当时上传时忘记更新model.py 现已更新 tf2.x将while_loop 转移到了tf.while_loop

您好,我怕是windows的原因,所以又在Ubuntu 上tf2.0跑了一下,之前的问题应该解决了; 现在的情况是我用的voc数据集,基于darknet53.conv.74转成的darknet53_weights.h5进行训练,错误信息如下: 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>. 没搜索到什么有用的信息,又来打扰您了

我也遇到同样的问题,请问您解决了吗?

meredith92 commented 3 years ago

当时上传时忘记更新model.py 现已更新 tf2.x将while_loop 转移到了tf.while_loop

您好,我怕是windows的原因,所以又在Ubuntu 上tf2.0跑了一下,之前的问题应该解决了; 现在的情况是我用的voc数据集,基于darknet53.conv.74转成的darknet53_weights.h5进行训练,错误信息如下: 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>. 没搜索到什么有用的信息,又来打扰您了

同样问题,有解答吗