• 服务器 PyTorch 报错 重装 PyTorch


    两个代码,pix2pix + CycleGan ,  wgan-gp 都是 pytorch 写的, 在服务器端运行,均存在下列问题,故判定是 pytorch 的安装问题。

    Traceback (most recent call last): File "train.py", line 13, in <module> model = create_model(opt) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/models.py", line 19, in create_model model.initialize(opt) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/cycle_gan_model.py", line 31, in initialize opt.ngf, opt.which_model_netG, opt.norm, not opt.no_dropout, self.gpu_ids) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 38, in define_G norm_layer = get_norm_layer(norm_type=norm) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 29, in get_norm_layer norm_layer = functools.partial(nn.InstanceNorm2d, affine=False) AttributeError: 'module' object has no attribute 'InstanceNorm2d' Traceback (most recent call last): File "train.py", line 13, in <module> model = create_model(opt) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/models.py", line 19, in create_model model.initialize(opt) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/cycle_gan_model.py", line 31, in initialize opt.ngf, opt.which_model_netG, opt.norm, not opt.no_dropout, self.gpu_ids) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 38, in define_G norm_layer = get_norm_layer(norm_type=norm) File "/wlwsea/pytorch-CycleGAN-and-pix2pix-master/models/networks.py", line 29, in get_norm_layer norm_layer = functools.partial(nn.InstanceNorm2d, affine=False) AttributeError: 'module' object has no attribute 'InstanceNorm2d'

    pytorch 安装十分便利,几秒钟大约,网址  http://pytorch.org/

    pix2pix + CycleGan 运行时可能缺包,是关键包没有安装,

    visdom这个包,主要是显示文字和图片,而在服务器端无法显示,所以,原始的命令后面要加 --display_id 0 。

    python train.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan --no_dropout --display_id 0

  • 相关阅读:
    (5)html表单
    (4)html表格
    (3)HTML ”列表“、图片和超链接
    (1)html开头解说与案例演示
    学习web前端前感
    一、资源合并与压缩
    HTTP协议原理
    图解HTTP总结
    基于TypeScript从零重构axios
    元組
  • 原文地址:https://www.cnblogs.com/wlwsea/p/7513179.html
Copyright © 2020-2023  润新知