volatile was removed and now has no effect. Use `with torch.no_grad():` instead.

UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
  molded_images = Variable(molded_images, volatile=True)

修改为

# Wrap in variable
        with torch.no_grad():
            molded_images = Variable(molded_images)


1. 其他的因为版本变动问题:

UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.
return F.log_softmax(x)

解决方法:把 F.log_softmax(x)改为F.log_softmax(x,dim=0) , 而且我发现改为F.log_softmax(x,dim=1),这个到底哪个更合理需要进一步确认。

 

2. 

UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值