SSD-Tensorflow icon indicating copy to clipboard operation
SSD-Tensorflow copied to clipboard

使用ssd_notebook.ipynb测试自己的模型出现问题,求大神解答?

Open zhangfudiyi opened this issue 6 years ago • 11 comments

在加载自己训练的模型时,出现错误 InvalidArgumentError : Assign requires shapes of both tensors to match. lhs shape= [126] rhs shape= [12]. 希望能得到解答,不知道为啥。谢了~!

zhangfudiyi avatar Jul 30 '18 12:07 zhangfudiyi

我也遇到了同样的问题.....

whmin avatar Jul 31 '18 04:07 whmin

问题已经解决,源代码中ssd_vgg_300.py中分类数需要修改和你自己数据一样的分类数目,作者给的是个指定值21。

zhangfudiyi avatar Aug 01 '18 06:08 zhangfudiyi

我也发现了,谢谢! 你训练的loss正常收敛了吗?

whmin avatar Aug 02 '18 02:08 whmin

您好,我加载自己的模型,报错: NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

Key ssd_300_vgg/conv1/conv1_1/biases/Adam not found in checkpoint 这个怎么解决?

KKKlose avatar Aug 30 '18 04:08 KKKlose

@KKKlose 你加载自己的模型需要保证网络结构和名称都是对的,不然就加载失败

dayL-W avatar Aug 30 '18 11:08 dayL-W

Dear All, Thanks for sharing this issue.

At first I follow the advice here, trying to modify ssd_vgg_300.py, but I got different error which was also lhs, rhs not matching.

Then, looking at how ssd_net is declared in train_ssd_network.py, I add the following code in jupyter notebook, and was able to run the notebook without error

ssd_class = ssd_vgg_300.SSDNet ssd_params = ssd_class.default_params._replace(num_classes=15) ssd_net = ssd_class(ssd_params)

BR, JimmyYS

speculaas avatar Nov 09 '18 10:11 speculaas

要怎么解决了,InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [12] rhs shape= [126]

2017TJM avatar May 03 '19 01:05 2017TJM

已经解决了,但是模型测试精度不行

2017TJM avatar May 04 '19 14:05 2017TJM

已经解决了,但是模型测试精度不行

麻烦问下怎么解决的呢?

imilesmile avatar May 05 '19 01:05 imilesmile

已经解决了,但是模型测试精度不行 我在做eval时,遇到了类似的问题,但我的ssd_vgg_300.py中的num_class已经修改过了还是出现这个问题。 请问能告知一下您的方法吗?我真的急切需要,拜托了!

yuchanWang avatar May 05 '19 10:05 yuchanWang

change line 96 at nets/ssd_vgg_300.py to num_classes= your custom class number

DalalAlmutawa avatar May 22 '21 18:05 DalalAlmutawa