You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this problem when I tried to inference on my own dataset. Could you give me some advice? Thank you!
Traceback (most recent call last):
File "train_net.py", line 317, in <module>
launch(
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/detectron2/engine/launch.py", line 67, in launch
mp.spawn(
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 198, in start_processes
while not context.join():
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 160, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:
-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/detectron2/engine/launch.py", line 126, in _distributed_worker
main_func(*args)
File "/home/data4/jieming/new_open_voc/CAT-Seg/train_net.py", line 302, in main
res = Trainer.test(cfg, model)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 608, in test
results_i = inference_on_dataset(model, data_loader, evaluator)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/detectron2/evaluation/evaluator.py", line 158, in inference_on_dataset
outputs = model(inputs)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/data4/jieming/new_open_voc/CAT-Seg/cat_seg/cat_seg_model.py", line 165, in forward
return self.inference_sliding_window(batched_inputs)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/home/data4/jieming/new_open_voc/CAT-Seg/cat_seg/cat_seg_model.py", line 249, in inference_sliding_window
image = rearrange(unfold(image), "(C H W) L-> L C H W", C=3, H=kernel)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/nn/modules/fold.py", line 294, in forward
return F.unfold(input, self.kernel_size, self.dilation,
File "/home/anaconda3/envs/kksan/lib/python3.8/site-packages/torch/nn/functional.py", line 4666, in unfold
raise NotImplementedError("Input Error: Only 4D input Tensors are supported (got {}D)".format(input.dim()))
NotImplementedError: Input Error: Only 4D input Tensors are supported (got 3D)
The text was updated successfully, but these errors were encountered:
# image = F.interpolate(images[0].unsqueeze(0), size=out_res, mode='bilinear', align_corners=False).squeeze()# image = rearrange(unfold(image), "(C H W) L-> L C H W", C=3, H=kernel)image=F.interpolate(images[0].unsqueeze(0), size=out_res, mode='bilinear', align_corners=False)
image=rearrange(unfold(image).squeeze(), "(C H W) L-> L C H W", C=3, H=kernel)
I got this problem when I tried to inference on my own dataset. Could you give me some advice? Thank you!
The text was updated successfully, but these errors were encountered: