繁体   English   中英

如何解决 pytorch 程序的问题?

[英]How can I solve the problem of pytorch program?

我想使用 pytorch 和我自己的数据集运行 python 程序。我遇到了错误:Traceback(最近一次调用最后一次):文件“C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py”,第 345 行,在 fire.Fire(demo) 文件“C:\Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\fire\core.py”中,第 138 行,在 Fire component_trace = _Fire(component, args , parsed_flag_args, context, name) 文件“C:\Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\fire\core.py”,第 468 行,在 _Fire 目标 = 组件中。 名称)文件“C:\Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\fire\core.py”,第 672 行,_CallAndUpdateTrace 组件 = fn(*varargs, **kwargs) 文件“ C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py",第 323 行,在演示 n_epochs=n_epochs,batch_size=batch_size,seed=seed) 文件“C:\Users\hp\Downloads\efficient_densenet_pytorch-master\ demoEmotion.py”,第 202 行,在火车 n_epochs=n_epochs,文件“C:\Users\hp\Downloads\efficient_densenet_pytorch-master\demoEmotion.py”,第 83 行,在 train_epoch output = 模型(输入)文件“C:\ Users\hp\Anaconda3\envs\tf-gpu\lib\site-packages\torch\nn\modules\module.py”,第 555 行,调用结果 = self.forward(*input, **kwargs) 文件“C :\Users\hp\Downloads\efficient_densenet_pytorch-master\models\densenet.py”,第 151 行,前向 features = self.features(x) 文件“C:\Users\hp\Anaconda3\envs\tf-gpu\lib \site-packages\torch\nn\modules\module.py",第 555 行,调用结果 = self.forward(*input, **kwargs) 文件“C:\U sers\hp\Anaconda3\envs\tf-gpu\lib\site-packages\torch\nn\modules\container.py”,第 100 行,前向输入 = 模块(输入)文件“C:\Users\hp\Anaconda3 \envs\tf-gpu\lib\site-packages\torch\nn\modules\module.py”,第 555 行,调用结果 = self.forward(*input, **kwargs) 文件“C:\Users\hp \Anaconda3\envs\tf-gpu\lib\site-packages\torch\nn\modules\container.py”,第 100 行,前向输入 = 模块(输入)文件“C:\Users\hp\Anaconda3\envs\ tf-gpu\lib\site-packages\torch\nn\modules\module.py”,第 555 行,调用结果 = self.forward(*input, **kwargs) 文件“C:\Users\hp\Anaconda3\ envs\tf-gpu\lib\site-packages\torch\nn\modules\pooling.py",第 557 行,前向 self.padding、self.ceil_mode、self.count_include_pad、self.divisor_override) RuntimeError:给定输入大小: (150x1x1)。 计算出的 output 大小:(150x0x0)。 Output 尺寸太小请指导我如何解决此问题。提前致谢!

请检查图像的输入尺寸。 它必须与 model 中的规定完全相同。 如果图像较小,您可以使用填充。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM