PingoLH / FCHarDNet

Fully Convolutional HarDNet for Segmentation in Pytorch
MIT License
195 stars 52 forks source link

Error in test.py #51

Closed takara-f closed 3 years ago

takara-f commented 3 years ago

When I tried test.py with my image on google colaboratory, I got an error.The commands and errors are shown below. Is there any solution?

!python test.py --model_path ./weights/hardnet70_cityscapes_model.pkl --dataset cityscapes --input /content/drive/MyDrive/test.jpg --output /content/results/

Traceback (most recent call last): File "test.py", line 119, in test(args) File "test.py", line 36, in test device, model, loader = init_model(args) File "test.py", line 21, in init_model test_mode=True File "/content/FCHarDNet/ptsemseg/loader/cityscapes_loader.py", line 82, in init self.images_base = os.path.join(self.root, "leftImg8bit", self.split) File "/usr/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

I'm Japanese and I'm sorry if my English is strange.

animesh-007 commented 3 years ago

When I tried test.py with my image on google colaboratory, I got an error.The commands and errors are shown below. Is there any solution?

!python test.py --model_path ./weights/hardnet70_cityscapes_model.pkl --dataset cityscapes --input /content/drive/MyDrive/test.jpg --output /content/results/

Traceback (most recent call last): File "test.py", line 119, in test(args) File "test.py", line 36, in test device, model, loader = init_model(args) File "test.py", line 21, in init_model test_mode=True File "/content/FCHarDNet/ptsemseg/loader/cityscapes_loader.py", line 82, in init self.images_base = os.path.join(self.root, "leftImg8bit", self.split) File "/usr/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

I'm Japanese and I'm sorry if my English is strange.

@F-TKR Are you still facing this issue? I also faced this issue but I was able to solve it. Let me know if you need any help.

jfhauris commented 3 years ago

@animesh-007 @F-TKR I am getting the same error. Is there a fix? I am trying to use test.py to test a single (or couple of) images. Can you share a typical test.py command line to do this? I am using the following but it is not working: python test.py --model_path '/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/models/hardnet.py' --dataset 'cityscapes' --input '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index.jpeg' --output '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index_output.jpeg'

In particular what should the --model_path point to? hardnet.py? or the weights *.pkl? Also why does --dataset point to cityscapes if I am trying to test my own data?

I get the following error:

File "test.py", line 122, in test(args) File "test.py", line 39, in test device, model, loader = init_model(args) File "test.py", line 24, in init_model test_mode=True File "/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/loader/cityscapes_loader.py", line 82, in init self.images_base = os.path.join(self.root, "leftImg8bit", self.split) File "/home/arl/anaconda3/envs/rgbsemseg/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

animesh-007 commented 3 years ago

@animesh-007 @F-TKR I am getting the same error. Is there a fix? I am trying to use test.py to test a single (or couple of) images. Can you share a typical test.py command line to do this? I am using the following but it is not working: python test.py --model_path '/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/models/hardnet.py' --dataset 'cityscapes' --input '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index.jpeg' --output '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index_output.jpeg'

In particular what should the --model_path point to? hardnet.py? or the weights *.pkl? Also why does --dataset point to cityscapes if I am trying to test my own data?

I get the following error:

File "test.py", line 122, in test(args) File "test.py", line 39, in test device, model, loader = init_model(args) File "test.py", line 24, in init_model test_mode=True File "/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/loader/cityscapes_loader.py", line 82, in init self.images_base = os.path.join(self.root, "leftImg8bit", self.split) File "/home/arl/anaconda3/envs/rgbsemseg/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

@jfhauris Sorry for late reply. If you are still facing any issues with test.py. Could you send me your email id I will try to provide my test.py to you?

jfhauris commented 3 years ago

@animesh-007 , Thanks, I would really appreciate you sending me a copy of your test.py jhauris@hotmail.co Thanks, Jon

jfhauris commented 3 years ago

Thanks animesh, I would really appreciate you sending me your test.py.  Jon

On Tuesday, April 27, 2021, 8:11:33 AM EDT, Animesh Gupta ***@***.***> wrote:  

@animesh-007 @F-TKR I am getting the same error. Is there a fix? I am trying to use test.py to test a single (or couple of) images. Can you share a typical test.py command line to do this? I am using the following but it is not working: python test.py --model_path '/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/models/hardnet.py' --dataset 'cityscapes' --input '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index.jpeg' --output '/home/arl/Documents/FCHARDNET/FCHarDNet-master/test_image/index_output.jpeg'

In particular what should the --model_path point to? hardnet.py? or the weights *.pkl? Also why does --dataset point to cityscapes if I am trying to test my own data?

I get the following error:

File "test.py", line 122, in test(args) File "test.py", line 39, in test device, model, loader = init_model(args) File "test.py", line 24, in init_model test_mode=True File "/home/arl/Documents/FCHARDNET/FCHarDNet-master/ptsemseg/loader/cityscapes_loader.py", line 82, in init self.images_base = os.path.join(self.root, "leftImg8bit", self.split) File "/home/arl/anaconda3/envs/rgbsemseg/lib/python3.6/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType

@jfhauris Sorry for late reply. If you are still facing any issues with test.py. Could you send me your email id I will try to provide my test.py to you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jfhauris commented 3 years ago

@animesh-007 Hi animesh, yes please send a copy of your test.py to jhauris@hotmail.com, Thanks, Jon