TimeMixer
TimeMixer copied to clipboard
CUDA error: no kernel image is available for execution on the device
(TimeMixer) lisheng@sunshine-System-Product-Name:~/TimeMixer_lab/TimeMixer-main$ bash ./scripts/short_term_forecast/PEMS/PEMS04.sh
是否使用gpu:True
Args in experiment:
Namespace(task_name='long_term_forecast', is_training=1, model_id='PEMS04', model='TimeMixer', data='PEMS', root_path='./dataset/PEMS/', data_path='PEMS04.npz', features='M', target='OT', freq='h', checkpoints='./checkpoints/', seq_len=96, label_len=0, pred_len=12, seasonal_patterns='Monthly', inverse=False, top_k=5, num_kernels=6, enc_in=307, dec_in=307, c_out=307, d_model=128, n_heads=4, e_layers=5, d_layers=1, d_ff=256, moving_avg=25, factor=3, distil=True, dropout=0.1, embed='timeF', activation='gelu', output_attention=False, channel_independence=0, decomp_method='moving_avg', use_norm=0, down_sampling_layers=1, down_sampling_window=2, down_sampling_method='avg', use_future_temporal_feature=0, mask_rate=0.25, anomaly_ratio=0.25, num_workers=10, itr=1, train_epochs=10, batch_size=32, patience=10, learning_rate=0.003, des='Exp', loss='MSE', lradj='TST', pct_start=0.2, use_amp=False, comment='none', use_gpu=True, gpu=0, use_multi_gpu=False, devices='0,1', p_hidden_dims=[128, 128], p_hidden_layers=2)
Use GPU: cuda:0
>>>>>>>start training : long_term_forecast_PEMS04_none_TimeMixer_PEMS_sl96_pl12_dm128_nh4_el5_dl1_df256_fc3_ebtimeF_dtTrue_Exp_0>>>>>>>>>>>>>>>>>>>>>>>>>>
data file: ./dataset/PEMS/PEMS04.npz
train 10088
data file: ./dataset/PEMS/PEMS04.npz
val 3291
data file: ./dataset/PEMS/PEMS04.npz
test 274
Traceback (most recent call last):
File "/home/lisheng/TimeMixer_lab/TimeMixer-main/run.py", line 161, in <module>
exp.train(setting)
File "/home/lisheng/TimeMixer_lab/TimeMixer-main/exp/exp_long_term_forecasting.py", line 169, in train
outputs = self.model(batch_x, batch_x_mark, dec_inp, batch_y_mark)
File "/home/lisheng/anaconda3/envs/TimeMixer/lib/python3.9/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/lisheng/TimeMixer_lab/TimeMixer-main/models/TimeMixer.py", line 517, in forward
dec_out = self.forecast(x_enc, x_mark_enc, x_dec, x_mark_dec)
File "/home/lisheng/TimeMixer_lab/TimeMixer-main/models/TimeMixer.py", line 342, in forecast
x_enc, x_mark_enc = self.__multi_scale_process_inputs(x_enc, x_mark_enc)
File "/home/lisheng/TimeMixer_lab/TimeMixer-main/models/TimeMixer.py", line 315, in __multi_scale_process_inputs
x_enc_sampling = down_pool(x_enc_ori)
File "/home/lisheng/anaconda3/envs/TimeMixer/lib/python3.9/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/lisheng/anaconda3/envs/TimeMixer/lib/python3.9/site-packages/torch/nn/modules/pooling.py", line 519, in forward
return F.avg_pool1d(
RuntimeError: CUDA error: no kernel image is available for execution on the device
我在run.py加了一句print(f'是否使用gpu:{args.use_gpu}')来检查是否可以用gpu,并且先前在环境下python检查print(torch.cuda.device_count())返回1,我怀疑是否是项目哪里的设置导致使用不了gpu,求解。 项目里的./scripts/short_term_forecast/PEMS/PEMS04.sh脚本文件只是从TimeMixer.sh文件摘了一部分,并且我运行TimeMixer.sh也是出现一样的问题,PEMS04.sh脚本文件内容如下: #export CUDA_VISIBLE_DEVICES=0
model_name=TimeMixer
seq_len=96 pred_len=12 down_sampling_layers=1 down_sampling_window=2 learning_rate=0.003 d_model=128 d_ff=256 batch_size=16 train_epochs=10 patience=10
python -u run.py
--task_name long_term_forecast
--is_training 1
--root_path ./dataset/PEMS/
--data_path PEMS04.npz
--model_id PEMS04
--model $model_name
--data PEMS
--features M
--seq_len $seq_len
--label_len 0
--pred_len $pred_len
--e_layers 5
--d_layers 1
--factor 3
--enc_in 307
--dec_in 307
--c_out 307
--des 'Exp'
--itr 1
--use_norm 0
--channel_independence 0
--d_model $d_model
--d_ff $d_ff
--batch_size 32
--learning_rate $learning_rate
--train_epochs $train_epochs
--patience $patience
--down_sampling_layers $down_sampling_layers
--down_sampling_method avg
--down_sampling_window $down_sampling_window\