AdvSemiSeg
AdvSemiSeg copied to clipboard
Facing Issue for running Adversarial Semi-Segmentation code on Custom dataset or CityScapes dataset
Hello everyone, Recently, I have managed to run the code correctly on Pascal VOC dataset, but when I tried to run the code on my own custom dataset or CityScape dataset, I am unable to run and faced debugging issues. Since I am working on python3.6, I made the following changes in the source code:
- substitute Enumerate.next() by Enumerate.next()
- substitute xrange by range
Also, I change the tensor type from gpu to cpu, e.g. images = Variable(images).cuda(args.gpu) to images = Variable(images).cpu(). As I searched on the internet, I noticed there might be some issue with the number of class. But then I guessed that I have correctly chosen the number of classes, as 30 classes in cityscapes case; or I changed the number of class to 31, but even then facing the same error. BTW, I'm running the code on GoogleColab, and it worked successfully for Pascal VOC dataset. The Error report is as below,
/usr/local/lib/python3.7/dist-packages/torch/optim/sgd.py:105: UserWarning: optimizer contains a parameter group with duplicate parameters; in future, this will cause an error; see github.com/pytorch/pytorch/issues/40967 for more information
super(SGD, self).init(params, defaults)
train.py:379: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
D_out = interp(model_D(F.softmax(pred)))
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:1960: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.
warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.")
train.py:382: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
ignore_mask_remain = np.zeros(D_out_sigmoid.shape).astype(np.bool)
/usr/local/lib/python3.7/dist-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
warnings.warn(warning.format(ret))
pred_train = 88
label_train = 88
Traceback (most recent call last):
File "train.py", line 524, in