Open lucky26418 opened 3 years ago
How exactly are you running? What are the command-line arguments?
my command-line arguments are like this: python main.py -m test --save-dir D:\Projects\PyTorch-ENet-master\save\ENet_Cityscapes --name ENet --dataset cityscapes --dataset-dir D:\DATASET\cityscapes --imshow-batch --height 512 --width 1024
And I successfully run the camvid dataset(Including train , test and cityscapes's training).
The annotations of the Cityscapes test dataset are not public and since you have --imshow-batch
it tries to display the annotation which then ends up causing the error you got. If you remove --imshow-batch
it should run the model in the test dataset but the metrics will be all set to nan like in #8
thanks for your prompt reply, but I got a new problem like this:
Traceback (most recent call last):
File "main.py", line 321, in
I try to change the code "loss = self.criterion(outputs, labels)" (File "D:\Projects\PyTorch-ENet-master\test.py", line 49, in run_epoch) like this "loss = self.criterion(outputs, labels, torch.squeeze(target).long())", there is still the same error. I read your other answers about the error "supported (3D tensors) but got targets of dimension: 4.", so I don't understand why this error happened here. looking forward to your support,thanks.
@lucky26418 , sorry for the late reply. Hope that in meantime you have resolved the issue since unfortunately, I could not reproduce your error using the command you posted before:
python main.py -m test --save-dir D:\Projects\PyTorch-ENet-master\save\ENet_Cityscapes --name ENet --dataset cityscapes --dataset-dir D:\DATASET\cityscapes --imshow-batch --height 512 --width 1024
Are you still trying to run with the command above?
Hi, I got the same issue .Did you have solved about this issue.I hope I can get your help,thank you!
@Stone-SL, please post here the command-line arguments that you are using and the error trace
This is my command-line arguements:
python main.py -m test --save-dir save/ENet_Cityscapes/ --name ENet --dataset cityscapes --dataset-dir Datasets/cityscapes/
And this is the error trace:
Traceback (most recent call last):
File "/home/ubuntu/project/SL/pyTorch-ENet/main.py", line 319, in
@Stone-SL, I'm unable to reproduce your error. If I run the command you posted on my machine the model is loaded and run on the test dataset. The output while and after evaluating should look like this:
>>>> Running test dataset
>>>> Avg. loss: 0.0000 | Mean IoU: nan
unlabeled: nan
road: nan
sidewalk: nan
building: nan
wall: nan
fence: nan
pole: nan
traffic_light: nan
traffic_sign: nan
vegetation: nan
terrain: nan
sky: nan
person: nan
rider: nan
car: nan
truck: nan
bus: nan
train: nan
motorcycle: nan
bicycle: nan
I got a problem when i test the model with cityscapes's dataset like this. How can I solve it?
Traceback (most recent call last): File "main.py", line 348, in
loaders, w_class, class_encoding = load_dataset(dataset)
File "main.py", line 124, in load_dataset
color_labels = utils.batch_transform(labels, label_to_rgb)
File "D:\Projects\ENetProjects\PyTorch-ENet-master\utils.py", line 21, in batch_transform
transf_slices = [transform(tensor) for tensor in torch.unbind(batch)]
File "D:\Projects\ENetProjects\PyTorch-ENet-master\utils.py", line 21, in
transf_slices = [transform(tensor) for tensor in torch.unbind(batch)]
File "D:\Applications\anaconda3\lib\site-packages\torchvision\transforms\transforms.py", line 61, in call
img = t(img)
File "D:\Projects\ENetProjects\PyTorch-ENet-master\transforms.py", line 92, in call
color_tensor[channel].maskedfill(mask, color_value)
RuntimeError: output with shape [360, 480] doesn't match the broadcast shape [3, 360, 480]