zoukankan      html  css  js  c++  java
  • Pytorch中的错误和bug

    RuntimeError:one of the variables needed for gradient computation has been modified by an inplace operation

    原因:0.4.0把Varible和Tensor融合为一个Tensor,inplace操作,之前对Varible能用,但现在对Tensor,就会出错了,所以找到模型中所有的inplace操作,换成非inplace的写法就行

    参考:https://blog.csdn.net/DuinoDu/article/details/80435127

    RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/THCTensorCopy.cu:102

    /pytorch/torch/lib/THCUNN/ClassNLLCriterion.cu:101: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [3,0,0] Assertion t >= 0 && t < n_classes failed.

    原因:有可能是最后一层的layer的参数num_labels不对,导致GPU跑的时候出错

    参考:https://github.com/pytorch/pytorch/issues/10303

  • 相关阅读:
    Alluxio部署(local模式)
    spring boot热部署
    zeppelin部署
    hbase集群搭建
    spark集群模式
    spark单机模式
    ssh免密码登录配置
    error: not found: value sc
    sublime插件
    sublime和webstorm安装zencoding
  • 原文地址:https://www.cnblogs.com/sbj123456789/p/9693948.html
Copyright © 2011-2022 走看看