Hzzone / Precipitation-Nowcasting

pytorch implemention of trajGRU.
553 stars 168 forks source link

RuntimeError: The size of tensor a (12) must match the size of tensor b (96) at non-singleton dimension 3 #15

Closed bugsuse closed 3 years ago

bugsuse commented 3 years ago

All parameters are default.

import torch
from nowcasting.config import cfg
from nowcasting.models.forecaster import Forecaster
from nowcasting.models.encoder import Encoder
from collections import OrderedDict
from nowcasting.models.model import EF
from torch.optim import lr_scheduler
from nowcasting.models.loss import Weighted_mse_mae
from nowcasting.models.trajGRU import TrajGRU
#from nowcasting.train_and_test import train_and_test
import numpy as np
from nowcasting.hko.evaluation import *
import copy
from experiments.net_params import *
from nowcasting.models.model import Predictor

encoder = Encoder(encoder_params[0], encoder_params[1]).to('cuda')
forecaster = Forecaster(forecaster_params[0], forecaster_params[1])
encoder_forecaster1 = EF(encoder, forecaster).to('cuda')
encoder_forecaster1(torch.randn(10, 8, 1, 64, 64).to('cuda'))
bugsuse commented 3 years ago

Well, it's ok when setting 480x480. Closed it!

encoder_forecaster1(torch.randn(10, 8, 1, 480, 480).to('cuda'))