TensorFlow2.0_SSD icon indicating copy to clipboard operation
TensorFlow2.0_SSD copied to clipboard

我想训练自己的模型但是报错了

Open sherrygux opened this issue 2 years ago • 10 comments

我想训练512的模型,把尺寸改了但是有如下错误 2023-05-02 13:07:23.003633: I tensorflow/core/common_runtime/executor.cc:1197] [/device:CPU:0] (DEBUG INFO) Executor start aborting (this does not indicate an error and you can ignore this message): INVALID_ARGUMENT: You must feed a value for placeholder tensor 'Placeholder/_0' with dtype string and shape [1] [[{{node Placeholder/_0}}]] 2023-05-02 13:07:23.003876: I tensorflow/core/common_runtime/executor.cc:1197] [/device:CPU:0] (DEBUG INFO) Executor start aborting (this does not indicate an error and you can ignore this message): INVALID_ARGUMENT: You must feed a value for placeholder tensor 'Placeholder/_0' with dtype string and shape [1] [[{{node Placeholder/_0}}]] Traceback (most recent call last): File "/pfs/data5/home/kit/wbk/ea7309/ssd512_py3.8/TensorFlow2.0_SSD/train.py", line 94, in main() File "/pfs/data5/home/kit/wbk/ea7309/ssd512_py3.8/TensorFlow2.0_SSD/train.py", line 52, in main loss_l, loss_c = loss_fn(y_true=labels, y_pred=predictions) File "/pfs/data5/home/kit/wbk/ea7309/ssd512_py3.8/TensorFlow2.0_SSD/core/loss.py", line 46, in call pos_idx = tf.broadcast_to(pos_idx, shape=loc_data.shape) File "/opt/bwhpc/common/jupyter/tensorflow/2023-03-24/lib/python3.9/site-packages/tensorflow/python/ops/gen_array_ops.py", line 864, in broadcast_to return broadcast_to_eager_fallback( File "/opt/bwhpc/common/jupyter/tensorflow/2023-03-24/lib/python3.9/site-packages/tensorflow/python/ops/gen_array_ops.py", line 910, in broadcast_to_eager_fallback _result = _execute.execute(b"BroadcastTo", 1, inputs=_inputs_flat, File "/opt/bwhpc/common/jupyter/tensorflow/2023-03-24/lib/python3.9/site-packages/tensorflow/python/eager/execute.py", line 52, in quick_execute tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _wrapped__BroadcastTo_device/job:localhost/replica:0/task:0/device:GPU:0}} Incompatible shapes: [8,8732,1] vs. [8,24656,4] [Op:BroadcastTo]

sherrygux avatar May 02 '23 11:05 sherrygux

我现在不用TensorFlow了,你可以用我最新写的这个代码:https://github.com/calmisential/DeepLearning.pytorch,里面有SSD算法

calmiLovesAI avatar May 02 '23 16:05 calmiLovesAI

我现在不用TensorFlow了,你可以用我最新写的这个代码:[https://github.com/calmisential/DeepLearning.pytorch,里面有SSD算法]我打开不了这个网页

sherrygux avatar May 02 '23 21:05 sherrygux

这个: https://github.com/calmisential/DeepLearning.pytorch

calmiLovesAI avatar May 03 '23 02:05 calmiLovesAI

SSD的配置文件是: https://github.com/calmisential/DeepLearning.pytorch/blob/main/configs/ssd_cfg.py 你可以在其中修改相关训练参数 接着把train.py里面的CONFIG修改为ssd的配置文件路径,然后运行train.py就可以开始训练了。 ssd要训出好的效果很难,建议你直接用我这个仓库里面的YOLOv8来做目标检测

calmiLovesAI avatar May 03 '23 02:05 calmiLovesAI

如果我使用的是512*512的图是直接改ssd_ cfg的尺寸就可以了嘛

sherrygux avatar May 03 '23 06:05 sherrygux

如果我使用的是512*512的图是直接改ssd_ cfg的尺寸就可以了嘛

输入只能是300*300,SSD512的网络结构与SSD300不一样,后续我有时间会把SSD512加上去

calmiLovesAI avatar May 03 '23 07:05 calmiLovesAI

好的,谢谢

sherrygux avatar May 03 '23 08:05 sherrygux

好的,谢谢

我更新了代码,现在可以输入512*512尺寸的图片了

calmiLovesAI avatar May 05 '23 14:05 calmiLovesAI

你有git push吗?为什么我没看到有更改呢?

sherrygux avatar May 05 '23 18:05 sherrygux

你有git push吗?为什么我没看到有更改呢?

这是commit

calmiLovesAI avatar May 06 '23 01:05 calmiLovesAI