无法复制PyTorch的神经转移examp

2024-03-29 09:34:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在遵循来自PyTorch's Neural Transfer的教程。然而,在下载Jupyter笔记本并运行它之后,我没有得到预期的输出。你知道我做错了什么吗?你知道吗

观测输出。你知道吗

Observed Output

预期产出。你知道吗

Expected Output

需要注意的是,我所处的环境没有CUDA支持(在Mac笔记本电脑上)。你知道吗

  • 康达4.5.0
  • python 2.7.17版
  • jupyter 4.4.0版
  • pytorch 0.3.1型
  • 火炬视觉0.2.0

我注意到观察到的输出是128x128,预期的是512x512(尽管,这种观察到的差异可能来自使用CPU或GPU的设置)。你知道吗

观察到的样式转换的输出如下所示。你知道吗

Building the style transfer model..
Optimizing..
run [50]:
Style Loss : 351316.375000 Content Loss: 53.188274

run [100]:
Style Loss : 318270.687500 Content Loss: 51.054543

run [150]:
Style Loss : 627803.375000 Content Loss: 59.788795

run [200]:
Style Loss : 351316.375000 Content Loss: 53.188274

run [250]:
Style Loss : 318270.687500 Content Loss: 51.054543

run [300]:
Style Loss : 627803.375000 Content Loss: 59.788795

预期的输出如下所示。你知道吗

Building the style transfer model..
Optimizing..
run [50]:
Style Loss : 0.147848 Content Loss: 0.470452

run [100]:
Style Loss : 0.043477 Content Loss: 0.343297

run [150]:
Style Loss : 0.035841 Content Loss: 0.315429

run [200]:
Style Loss : 0.031865 Content Loss: 0.306764

run [250]:
Style Loss : 0.030837 Content Loss: 0.302101

run [300]:
Style Loss : 0.030777 Content Loss: 0.299595

Tags: therunmodelstylejupyter教程pytorchcontent