Giter VIP home page Giter VIP logo

Comments (2)

SiYXiN avatar SiYXiN commented on July 20, 2024

您好,我是一名研二学生,想通过您的代码学习convLSTM,但是在进行训练的时候,运行“train_model('nox',model_nox)”总是出现如下错误:"Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead."可以向您请教一下是什么原因吗,谢谢您啦

你好,我想问一下你前面的问题解决了么

from air_pollutants_prediction_lstm.

keyboardman42 avatar keyboardman42 commented on July 20, 2024

这个错误是由于你试图将一个带有梯度信息的Tensor类型变量转换为numpy数组导致的
如果你有一个带梯度信息的Tensor类型变量t,你希望将其转换为ndarray,可以通过以下代码实现
array = t.detach().numpy()

from air_pollutants_prediction_lstm.

Related Issues (2)

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.