Closed kaishijeng closed 4 years ago
Hi @kaishijeng ! Thank you for your interest in our work!
Please follow the instructions in our Readme for pretrained models and making predictions.
I have downloaded teacher and student models and put them under fasterseg directory. Also modify C.is_test = True. When I run python train.py, I got the following errors:
Traceback (most recent call last):
File "train.py", line 32, in
Any idea why this error happens? Also how I can provide my own test image when I can run python train.py?
Thanks,
Have you googled this error?
I met this error before, and I am pretty sure you can find answer on google.
Sorry I missed your second question.
Basically you could do a similar preparation for the Cityscapes to your images: prepare the file list and update the configure files.
You don't need to prepare the labels.
Please do read our instructions on evaluation and test to get yourself familiar with the code usage. :)
OK, I follow changes in the README and am able to run it. But it encounters erros below until it starts to do training. What changes I need to do to avoid the training when I run python train.py? I just want to do an inference on a single image with this pretrained model, arch_1.pt
data = fetcher.fetch(index)
File "/home/henry/miniconda3/envs/remnav/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/henry/miniconda3/envs/remnav/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
Thanks,
See here: https://github.com/TAMU-VITA/FasterSeg/blob/master/train/train.py#L160
Turn both is_eval
and is_test
to be True
in the configuration, then you can simply do the inference without training.
Yes, I found that out and it can run without a training. Thanks. Since there is no GT for inference, I use the same image in cityscapes_test.txt as below: test_images/test.png test_images/test.png
However, I have the following error with test.png which is 1280x720 whin I run it:
.
Traceback (most recent call last):
File "./train.py", line 297, in
I see. The problem is because 720/64=11.25
not being an integer, as our network will downsample the input to 1/64
scale at the extreme (zoomed conv will downsample 1/32
to 1/64
during the feed-forward).
The most straightforward way to get the inference work is to make both the height and width to be divisible to 64, for example, by either upsampling your input to 1280x768
or downsampling to 1280x704
. A small change to the aspect ratio should not be a problem.
Now it works. Is test output a gray image instead of color? I saw one below which is a gray image: eval-512x1024_student_batch12-20200312-223648/test_1_0/test.png
Thanks,
No -- it is a prediction file which contains integers from 0~18 representing semantic classes.
You could set show_prediction = True
when creating the tester
for visualization purpose.
I set it, but nothing shows up. It seems show_prediction flag is not used in tester.py Thanks,
No, the SegTester
does use the show_prediction
flag. I used this code to make the gif shown in the Readme.
Please check if there is any png file ends with ".viz.png".
Yes, I found color image in .viz.png. Thanks for all helps.
Do you have a pretrained model and test code which can do inference on a single image?
Thanks,