zju3dv / snake

Code for "Deep Snake for Real-Time Instance Segmentation" CVPR 2020 oral
Other
1.15k stars 229 forks source link

训练时出现invalid device pointer #213

Closed samwang90 closed 2 years ago

samwang90 commented 2 years ago

作者你好,这是我遇到的问题 Traceback (most recent call last): File "train_net.py", line 54, in main() File "train_net.py", line 50, in main train(cfg, network) File "train_net.py", line 25, in train trainer.train(epoch, train_loader, optimizer, recorder) File "/home/dayu/snake/lib/train/trainers/trainer.py", line 38, in train output, loss, loss_stats, image_stats = self.network(batch) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in call result = self.forward(*input, *kwargs) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 148, in forward inputs, kwargs = self.scatter(inputs, kwargs, self.device_ids) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 159, in scatter return scatter_kwargs(inputs, kwargs, device_ids, dim=self.dim) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 35, in scatter_kwargs inputs = scatter(inputs, target_gpus, dim) if inputs else [] File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 28, in scatter return scatter_map(inputs) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 15, in scatter_map return list(zip(map(scatter_map, obj))) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 19, in scatter_map return list(map(type(obj), zip(map(scatter_map, obj.items())))) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 15, in scatter_map return list(zip(map(scatter_map, obj))) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/scatter_gather.py", line 13, in scatter_map return Scatter.apply(target_gpus, None, dim, obj) File "/home/dayu/anaconda3/envs/snake/lib/python3.7/site-packages/torch/nn/parallel/_functions.py", line 96, in forward output.record_stream(main_stream) RuntimeError: invalid device pointer: %p0

pengsida commented 2 years ago

看起来是因为输入数据为空的问题。你是在自己数据上训练吗

samwang90 commented 2 years ago

看起来是因为输入数据为空的问题。你是在自己数据上训练吗

是在自己数据上训练的,那我再查一遍数据