models icon indicating copy to clipboard operation
models copied to clipboard

gan例子infer错误

Open githubusr1 opened this issue 7 years ago • 8 comments

我使用https://github.com/PaddlePaddle/models/tree/develop/PaddleCV/PaddleGAN,里的infer.py和https://paddle-gan-models.bj.bcebos.com/stargan_G.tar.gz的预训练模型去预测老是出错: C++ Callstacks: Enforce failed. Expected in_dims[1] == filter_dims[1] * groups, but received in_ dims[1]:16 != filter_dims[1] * groups:8. The number of input channels should be equal to filter channels * groups. at [D: \1.4.1\paddle\paddle\fluid\operators\conv_op.cc:64] PaddlePaddle Call Stacks: Windows not support stack backtrace yet.

详细输出信息见附件output.txt文件。文件基本没改。我调试的一点看法是, exe.run初始化能print看到里网络输出了,(1,3,128,128)数据,表示网络没问题,feed数据后就exe.run就报错,判断是输入不对,检查输入input:(1,3,128,128), label trg (1,13)和data定义一样,但就是报错,没办法了,请帮助。infer.py,data_reaer.py有小小改动,需要发给你,基本和没改一样。 环境信息: python:3.7.1 paddle: 1.4.1 os: win7 64bit gpu: no output.txt

githubusr1 avatar Aug 15 '19 07:08 githubusr1

把改动的地方发一下吧 @githubusr1

sandyhouse avatar Aug 15 '19 11:08 sandyhouse

把改动的地方发一下吧 @githubusr1

@sandyhouse

testganinfer.zip data_reader.zip

githubusr1 avatar Aug 16 '19 02:08 githubusr1

@sandyhouse

githubusr1 avatar Aug 16 '19 07:08 githubusr1

@sandyhouse testganinfer.py data_reader.py见上面附件zip

githubusr1 avatar Aug 16 '19 07:08 githubusr1

是因为预训练模型是5个label,所以直接加载这个预训练模型预测13个label的图片会报错,要测试13个label的图片的话,需要重新训练13个label的模型

ceci3 avatar Aug 16 '19 12:08 ceci3

@ceci3 谢谢答复,我把label数改5了(c_dim=5),有新的错误,详细错误信息见附件。这个怎么解决。 C++ Callstacks: Cannot find fetch variable in scope, fetch_var_name is g at [D:\1.4.1\paddle\pad dle\fluid\operators\controlflow\fetch_op.cc:37] PaddlePaddle Call Stacks: Windows not support stack backtrace yet. outprint.txt

githubusr1 avatar Aug 17 '19 02:08 githubusr1

@sandyhouse

githubusr1 avatar Aug 17 '19 06:08 githubusr1

解决了,谢谢。

githubusr1 avatar Aug 17 '19 08:08 githubusr1