yunlongdong / FCN-pytorch

Another pytorch implementation of FCN (Fully Convolutional Networks)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use inference.py?

tranvnhan opened this issue · comments

commented

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.

commented

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.

commented

Update: running inference on GPU and CPU return the same result. The problem might come from conflicts during building PyTorch from source.