Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in test.py #42

Open
hona-p opened this issue Jun 25, 2020 · 5 comments
Open

Errors in test.py #42

hona-p opened this issue Jun 25, 2020 · 5 comments

Comments

@hona-p
Copy link

hona-p commented Jun 25, 2020

When I use this command to test I got error:

python test.py --model_path weights/hardnet70_cityscapes_model.pkl --dataset cityscapes --size 2048,1024 --input [input/a.jpg] --output [output]

The following error occurred. Please point out what needs to be fixed.

Error:
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 16, in init_model
data_loader = get_loader("icboard")
File "C:\Users\students\Desktop\rakuseki\seg\FCHarDNet-master\ptsemseg\loader_init_.py", line 27, in get_loader
}[name]
KeyError: 'icboard'

The weight files and input image files are located in the following paths.
--model_path weights/hardnet70_cityscapes_model.pkl
--input input/a.jpg]

@SiftingSands
Copy link

Replace icboard in line 16, data_loader = get_loader("icboard"), with whatever dataset you're running on. Or just use args.dataset instead of hard-coding it.

@EchoAmor
Copy link

@PingoLH @SiftingSands Hello,I met another problem when I run the test.py ,
my commonds like this:

--model_path ./weights/hardnet70_cityscapes_model_2.pkl
--dataset cityscapes
--input /media/echo/Echo/datasets/Cityscapes/leftImg8bit/test/berlin

but it keeps appearancing this error:
Screenshot from 2020-08-18 11-02-19

do u know what's the problem is?thanks very much !!!

@SiftingSands
Copy link

Try "--input /media/echo/Echo/datasets/Cityscapes". That cityscapes dataloader is already making assumptions on your directory structure.

@EchoAmor
Copy link

@SiftingSands thanks I will try !

@jfhauris
Copy link

@SiftingSands @EchoAmor @PingoLH
Hi, 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 <module>
    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants