kazuto1011 / pspnet-pytorch

PyTorch re-implementation of PSPNet
MIT License
52 stars 11 forks source link

What is yaml? #3

Closed cao-nv closed 6 years ago

cao-nv commented 6 years ago

I have a question about the yaml. What is yaml' here? In caffe, models are save in .caffemodel, non yaml. I downloaded thepspnet101_VOC2012.caffemodelfrom @hszhao's repo and put it indata/modelsthen I ranpython convert.py -c data/models/pspnet101_VOC2012.caffemodel` but it generated following error:

Traceback (most recent call last):
  File "convert.py", line 161, in <module>
    main()
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "convert.py", line 117, in main
    CONFIG = Dict(yaml.load(open(config)))
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/yaml/__init__.py", line 69, in load
    loader = Loader(stream)
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/yaml/loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/yaml/reader.py", line 85, in __init__
    self.determine_encoding()
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/yaml/reader.py", line 135, in determine_encoding
    self.update(1)
  File "/mnt/hdd1/cao/.global_env/local/lib/python2.7/site-packages/yaml/reader.py", line 165, in update
    exc.encoding, exc.reason)
yaml.reader.ReaderError: 'utf8' codec can't decode byte #xa2: invalid start byte
  in "data/models/pspnet101_VOC2012.caffemodel", position 2
kazuto1011 commented 6 years ago

Sorry for the confusing readme. The yaml is used as a configuration file here, which includes data paths, model definition, and so on. Try running python convert.py -c config/voc12_ss.yaml instead. The model conversion, evaluation, and demo are all through the yaml file.

cao-nv commented 6 years ago

Thank you 👍