How to use inference.py?
tranvnhan opened this issue · 3 comments
I can run the training phase and I've had the checkpoint file.
Now the problem is how to use the provided inference.py
. In that file, I see you generate a random input and use the pretrained model. What about loading a test image and running inference on it? How to do it specifically?
Thanks.
Update: I can run inference using GPU but when I do the same with CPU I get a totally different result.
What might be the problem?
Thank you in advance!
u can use https://github.com/yunlongdong/FCN-pytorch-easiest/blob/master/BagData.py to load test image to be tensor of torch by torchvision.transforms.
Update: running inference on GPU and CPU return the same result. The problem might come from conflicts during building PyTorch from source.