hzzone / precipitation-nowcasting Goto Github PK
View Code? Open in Web Editor NEWpytorch implemention of trajGRU.
pytorch implemention of trajGRU.
代码是训练ConvLSTM的train_and_test函数部分:
for itera in tqdm(range(1, max_iterations+1)):
lr_scheduler.step()
train_batch, train_mask, sample_datetimes, _ = \
train_hko_iter.sample(batch_size=batch_size)
train_batch = torch.from_numpy(train_batch.astype(np.float32)).to(cfg.GLOBAL.DEVICE) / 255.0
train_data = train_batch[:IN_LEN, ...]
train_label = train_batch[IN_LEN:IN_LEN + OUT_LEN, ...]
mask = torch.from_numpy(train_mask[IN_LEN:IN_LEN + OUT_LEN, ...].astype(int)).to(cfg.GLOBAL.DEVICE)
When I run config.py, it appears ImportError: cannot import name 'activation' from partially initialized module 'nowcasting.models.model' (most likely due to a circular import) (D:\tmx2023\mlcode\Precipitation-Nowcasting-master\nowcasting\models\model.py) Error.
As each RNN block receives 2 inputs x and h(history), for the first RNN block of "decoder" (by first I mean the one shown in the image) 1. what do u input instead of history and x? 2. Is it correct to assume input=zeros and history=last output of encoder?
When I read Shi's paper "Convolutional LSTM Network: A Machine Learning:Approach for Precipitation Nowcasting", in his experiments on moving mnist dataset, he shape img data (64*64*1) to (16*16*16). I'm confused about it, is it because of gpu memory and is it appropriate of this way? Thanks!
The paper said The spatial coordinates G are concatenated to the input frame to ensure the network knows the observations are from different locations, but I did not find it in your code?
Could you tell me how to do it or where to find it ?
Hi, I just realised that you are actually using the valid set to report the benchmarks, I think we should be using test set.
"../traj_rnn.py", line 139, in forward
S, B, C, H, W = inputs.size()
ValueError: not enough values to unpack (expected 5, got 1)
请问这个问题是什么导致的?这5个S,B,C,H,W的输入是如何输入进来的呢?
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'))
I have tried many methods but cannot solve this problem, and I have tested that numba has been installed successfully.
First of all thank you so much for sharing your code.
I have a problem during training:
Why can an iteration take about 12s?
like this:
0%| | 8/100000 [01:36<336:01:47, 12.10s/it]
Is the process of loading data too time-consuming.
Hope to get your answer!
Thank you!
Thanks for sharing the repo. I want to use the Repo to test the prediction of combustion flame,but i haven't got the hko-77 dataset, i don't know the extract data construction. I will appreciate it if you can share me the construction of the dataset. And my e-mail is [email protected].
Thank you very much
Best,
Fresh man
Look at this file: Precipitation-Nowcasting/nowcasting/models/model.py:
`
class EF(nn.Module):
def __init__(self, encoder, forecaster):
super().__init__()
self.encoder = encoder
self.forecaster = forecaster
def forward(self, input):
state = self.encoder(input) # <--- look here, all communication between encoder and forecaster are the variate: state, it's not right implementation of encoder-forecaster structure
output = self.forecaster(state)
return output
`
For example, in encoder-forecaster structure, a cell must receive the cell states of left cell (at the same level) as input except the cell states from up/down level, but the code didn't implement it, so it's a seq2seq structure, not a encoder-forecaster structure.
Contact me for more details if the author think it's necessary: Qq: 1 0 three three one 6 1 wu wu si
Left pictures are the ground truth sequences, and right pictures are the predicted sequences?
What are the paths 'HKO_PNG_PATH' and 'HKO_MASK_PATH' in config.py used for?
Are they temporary directories and supposed to be empty before running , or supposed to be filled with some input png pictures(if so, how can I get those pictures)?
for dirs in ['/Users/hzzone/Downloads/HKO-7_data/radarPNG', '/home/hzzone/HKO-7/radarPNG']: if os.path.exists(dirs): __C.HKO_PNG_PATH = dirs
When I run python 'experiments/trajGRU_balanced_mse_mae/main.py'
with those directories empty, IOError occured, details were as follow:
Traceback (most recent call last): File "experiments/trajGRU_balanced_mse_mae/main.py", line 49, in <module> train_and_test(encoder_forecaster, optimizer, criterion, mult_step_scheduler, batch_size, max_iterations, test_iteration_interval, test_and_save_checkpoint_iterations, folder_name) File "C:\Users\Dennis\Desktop\2020.10.26 radar\Precipitation-Nowcasting-master\nowcasting\train_and_test.py", line 53, in train_and_test train_hko_iter.sample(batch_size=batch_size) File "C:\Users\Dennis\Desktop\2020.10.26 radar\Precipitation-Nowcasting-master\nowcasting\hko\dataloader.py", line 453, in sample frame_dat, mask_dat = self._load_frames(datetime_clips=datetime_clips) File "C:\Users\Dennis\Desktop\2020.10.26 radar\Precipitation-Nowcasting-master\nowcasting\hko\dataloader.py", line 324, in _load_frames grayscale=True) File "C:\Users\Dennis\Desktop\2020.10.26 radar\Precipitation-Nowcasting-master\nowcasting\hko\image.py", line 115, in quick_read_frames raise IOError OSError
你好师兄,请问你使用的是pretrained里面的模型吗?我想要装入自己的数据集,并且训练模型,然后输入测试的图片。请问这个具体怎么操作,麻烦了。如果方便,加我QQ:446822646
Those who have researched similar issues can add me on WeChat, and we can learn and exchange ideas together, making progress together. Weicat: LBJ-2021, Email: [email protected]
hey! first of all thanks for your implementation. what is the format of the hko dataset? I need to use your implementation for my data (sequence of images but in 11 channels) and want to predict the next sequence of frames. Is it possible with this implementation?
师兄你好,我想请问,HKO-7当中的“hko_rnn_test.py”这个是不是根据一个雷达序列图像,预测出接下来的序列图像?如果不是的话,请问下那个程序是解决这个问题的呢?其实我没太明白训练的trajGRU模型是用来做什么工作的。你能给我具体说明下吗?很感谢了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.