Giter Club home page Giter Club logo

Comments (3)

chuanchuan12138 avatar chuanchuan12138 commented on July 28, 2024 3

对比main和main_predict的predict函数,看里面的1和0对着改一下就好了。

from da-rnn.

Apogeum12 avatar Apogeum12 commented on July 28, 2024

Hey I have this same issue, how i can solve this ? I don't understand previous answer :(
My error
######################################
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/jezus/Downloads/Sieci/Sars2020/Script_version/da-rnn-master/main_predict.py', wdir='C:/Users/jezus/Downloads/Sieci/Sars2020/Script_version/da-rnn-master')

File "C:\Users\jezus\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "C:\Users\jezus\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/jezus/Downloads/Sieci/Sars2020/Script_version/da-rnn-master/main_predict.py", line 74, in
final_y_pred = predict(enc, dec, data, **da_rnn_kwargs)

File "C:/Users/jezus/Downloads/Sieci/Sars2020/Script_version/da-rnn-master/main_predict.py", line 49, in predict
y_pred[y_slc] = decoder(input_encoded, y_history).cpu().data

File "C:\Users\jezus\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)

File "C:\Users\jezus\Downloads\Sieci\Sars2020\Script_version\da-rnn-master\modules.py", line 107, in forward
y_tilde = self.fc(torch.cat((context, y_history[:, t]), dim=1)) # (batch_size, out_size)

File "C:\Users\jezus\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 541, in call
result = self.forward(*input, **kwargs)

File "C:\Users\jezus\Anaconda3\lib\site-packages\torch\nn\modules\linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)

File "C:\Users\jezus\Anaconda3\lib\site-packages\torch\nn\functional.py", line 1370, in linear
ret = torch.addmm(bias, input, weight.t())

RuntimeError: size mismatch, m1: [128 x 40624], m2: [65 x 1] at C:/w/1/s/tmp_conda_3.7_104508/conda/conda-bld/pytorch_1572950778684/work/aten/src\THC/generic/THCTensorMathBlas.cu:290

###########################################################

from da-rnn.

Apogeum12 avatar Apogeum12 commented on July 28, 2024

Ok I solved this:
In main_predict.py in function predict()
change the shape from 0 to 1 in y_history t_dat.targs.shape[0] -> t_dat.targs.shape[1]

from da-rnn.

Related Issues (20)

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.