iArunava/ENet-Real-Time-Semantic-Segmentation

Error while validating

th3-buNNy-gUy opened this issue · 6 comments

[INFO]Defined all the hyperparameters successfully!
[INFO]Starting to define the class weights...
[INFO]Fetched all class weights successfully!
[INFO]Model Instantiated!
[INFO]Defined the loss function and the optimizer
[INFO]Staring Training...
--------------- Epoch 1 ---------------
100%|███████████████████████████████████████████| 36/36 [08:39<00:00, 12.16s/it]

Epoch 1/102... Loss 80.269591
0%| | 0/10 [00:00<?, ?it/s]
Traceback (most recent call last):
File "init2.py", line 68, in
train(FLAGS)
File "/home/vadmin/Documents/Semantic_Segmentation/prebuilt_model/ENet-Real-Time-Semantic-Segmentation/train.py", line 105, in train
loss = criterion(out, labels.long())
File "/home/vadmin/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/vadmin/Documents/Semantic_Segmentation/prebuilt_model/ENet-Real-Time-Semantic-Segmentation/models/ENet.py", line 191, in forward
x = self.init(x)
File "/home/vadmin/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/vadmin/Documents/Semantic_Segmentation/prebuilt_model/ENet-Real-Time-Semantic-Segmentation/models/InitialBlock.py", line 37, in forward
main = self.conv(x)
File "/home/vadmin/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/vadmin/.local/lib/python3.5/site-packages/torch/nn/modules/conv.py", line 320, in forward
self.padding, self.dilation, self.groups)
RuntimeError: _thnn_conv2d_forward is not implemented for type torch.ByteTensor

The problem is that the input you give to your network is of type ByteTensor while only float operations are implemented for conv like operations.
Check please the folder of the training data, does it contain images only?

My input type is .jpg.... I guess that isn't the cause of the error?
yes it does contains images only.

I think it might. I will fix it. in the meantime try to convert it to .png and run.
Update me if that helps.

@AvivSham Converting the images to png was the solution.. Thank you for the help.

No problem. We will fix this limitation.