Comments (3)
对比main和main_predict的predict函数,看里面的1和0对着改一下就好了。
from da-rnn.
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.
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)
- Error using CUDA HOT 4
- why not use tanh in encoder while use it in decoder ? HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: '/da-rnn/plots/pred_0.png' HOT 1
- one of the variables needed for gradient computation has been modified by an inplace operation
- How many epoch should I choose? HOT 1
- why use companies' stock price to predict NASDAQ-100 Index?
- Is there any room for gpu memory improvements? HOT 2
- The result value is different from raw data because of StandardScaler(). How can I get the plots and calculate MSE use raw data?
- It's weird that this code can only performance well on predicting 'NDX' HOT 1
- Dose this model genelarize well on your (other) dataset? HOT 1
- Evaluation mode missing on validation and predict
- tensor problem
- Multi-Step Prediction
- Can't find tanh function in eqn. 8 HOT 1
- Current values of external factor are used for prediction in your code? HOT 11
- Regarding scaling of data HOT 2
- Reg predicting the output HOT 1
- NaN issues when changing dat-aset. HOT 2
- Data overlapping in train/test split HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from da-rnn.