RolandGao / RegSeg

The official implementation of "Rethink Dilated Convolution for Real-time Semantic Segmentation"
MIT License
86 stars 14 forks source link

Can not show.py #6

Closed sounansu closed 2 years ago

sounansu commented 2 years ago

I try show.py. But I can not.

$ python3 show.py
name= cityscapes
train size: 2975
val size: 500
Traceback (most recent call last):
  File "show.py", line 358, in <module>
    show_cityscapes_model()
  File "show.py", line 337, in show_cityscapes_model
    show(model,val_loader,device,show_cityscapes_mask,num_images=num_images,skip=skip,images_per_line=images_per_line)
  File "show.py", line 134, in show
    outputs = model(images)
  File "/home/sounansu/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/sounansu/RegSeg/model.py", line 76, in forward
    x=self.stem(x)
  File "/home/sounansu/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/sounansu/RegSeg/blocks.py", line 22, in forward
    x = self.conv(x)
  File "/home/sounansu/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/sounansu/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 446, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/home/sounansu/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 442, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
RolandGao commented 2 years ago

Can you git pull and try again? I made some changes.

sounansu commented 2 years ago

Thank You! RolandGao. I can do show.py, and pop up this windows.

screenshot