GithubHelp home page GithubHelp logo

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation about edge-informed-sisr HOT 2 OPEN

ghzmwhdk777 avatar ghzmwhdk777 commented on May 26, 2024
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

from edge-informed-sisr.

Comments (2)

jakubcaputa avatar jakubcaputa commented on May 26, 2024

Hey, did you solve this issue?

from edge-informed-sisr.

zhangzheng2242 avatar zhangzheng2242 commented on May 26, 2024

开始训练...

训练时期:1 /usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py:92:UserWarning:给定的 NumPy 数组不可写,PyTorch 不支持不可写张量。这意味着您可以使用张量写入底层(假定不可写)NumPy 数组。您可能希望复制数组以保护其数据或使其可写,然后再将其转换为张量。对于该程序的其余部分,将禁止此类警告。(在 /pytorch/torch/csrc/utils/tensor_numpy.cpp:141 内部触发。) img = torch.from_numpy(np.array(pic, np.float32, copy=False)) /usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py:92:用户警告:给定的 NumPy 数组不可写,并且 PyTorch 不支持不可写张量。这意味着您可以使用张量写入底层(假定不可写)NumPy 数组。您可能希望复制数组以保护其数据或使其可写,然后再将其转换为张量。对于该程序的其余部分,将禁止此类警告。(在 /pytorch/torch/csrc/utils/tensor_numpy.cpp:141 内部触发。) img = torch.from_numpy(np.array(pic, np.float32, copy=False)) /usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py:92:用户警告:给定的 NumPy 数组不可写,并且 PyTorch 不支持不可写张量。这意味着您可以使用张量写入底层(假定不可写)NumPy 数组。您可能希望复制数组以保护其数据或使其可写,然后再将其转换为张量。对于该程序的其余部分,将禁止此类警告。(在 /pytorch/torch/csrc/utils/tensor_numpy.cpp:141 内部触发。) img = torch.from_numpy(np.array(pic, np.float32, copy=False)) /usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py:92:用户警告:给定的 NumPy 数组不可写,并且 PyTorch 不支持不可写张量。这意味着您可以使用张量写入底层(假定不可写)NumPy 数组。您可能希望复制数组以保护其数据或使其可写,然后再将其转换为张量。对于该程序的其余部分,将禁止此类警告。(在 /pytorch/torch/csrc/utils/tensor_numpy.cpp:141 内部触发。) img = torch.from_numpy(np.array(pic, np.float32, copy=False)) Traceback(最近一次调用最后一次): 文件“main.py”,第 120 行,在 main(mode=1) 文件“main.py”,第 50 行,在 main model.train() 文件“/content/drive/MyDrive/Colab Notebooks/SR/edge-informed-sisr-master/src/edge_match.py​​”,第 133 行,在火车 self.sr_model.backward(gen_loss, dis_loss) 文件“/content/drive /MyDrive/Colab Notebooks/SR/edge-informed-sisr-master/src/models.py”,第 283 行,在向后的 gen_loss.backward() 文件中“/usr/local/lib/python3.6/dist-packages/ torch/tensor.py”,第 221 行,后向 torch.autograd.backward(self, gradient, retain_graph, create_graph)文件 “/usr/local/lib/python3.6/dist-packages/torch/autograd/init .py ",第 132 行,后向 allow_unreachable=True) #allow_unreachable 标志****

RuntimeError:梯度计算所需的变量之一已被就地操作修改:[torch.cuda.FloatTensor [1, 512, 4, 4]] 为版本 2;而是预期的版本 1。提示:启用异常检测以查找未能计算其梯度的操作,使用 torch.autograd.set_detect_anomaly(True)。

有人知道这个错误并回答吗?

Hey, did you solve this issue?

Hey, did you solve this issue?

from edge-informed-sisr.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.