speedinghzl / DSRG

Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR 2018).
MIT License
251 stars 36 forks source link

Training Issue likely from Version Conflicts #6

Open mcever opened 5 years ago

mcever commented 5 years ago

Hi,

I am trying to use the DSRG code, and I am beginning by trying to train a model myself using the run script; however, I get the following error each time the code tries to import caffe:

$ bash run.sh
/media/ssd1/austin/DSRG/deeplab-public-ver2/python
Traceback (most recent call last):
File "../../tools/train.py", line 12, in
import caffe
File "/media/ssd1/austin/DSRG/deeplab-public-ver2/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver , AdamSolver
File "/media/ssd1/austin/DSRG/deeplab-public-ver2/python/caffe/pycaffe.py", line 15, in
import caffe.io
File "/media/ssd1/austin/DSRG/deeplab-public-ver2/python/caffe/io.py", line 8, in
from caffe.proto import caffe_pb2
File "/media/ssd1/austin/DSRG/deeplab-public-ver2/python/caffe/proto/caffe_pb2.py", line 905, in options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\020\001')), file=DESCRIPTO$), TypeError: new() got an unexpected keyword argument 'file'

I found a similar issue here (https://github.com/BVLC/caffe/issues/6143), which suggests that I have the wrong version of something, but I'm trying to work out which dependency is causing the problem. I don't have much experience with caffe, but I expect it's an issue with Ubuntu packages (like libprotobuf or protoc) as I'm using a virtual environment for all my Python packages.

Any help is much appreciated.

mcever commented 5 years ago

I was able to move past this particular issue by upgrading my python protobuf to 3.6.1 over the 3.0.0 listed in python-requirements.txt.

mcever commented 5 years ago

Further, I had to pip install pyyaml and sklearn.

speedinghzl commented 5 years ago

@mcever Have you solved the problem? You throw much information which may be irrelevant to your question. Maybe you can check your caffe by running make runtest before running DSRG.

mcever commented 5 years ago

@speedinghzl thanks for the reply. Yes, the issue was that the python-requirements.txt has an old version of protobuf that is incompatible with the project, and the python-requirements.txt is missing a couple of other dependencies.

mcever commented 5 years ago

Another missing Python package: pydensecrf, referenced in the code but not in python-requirements.txt https://github.com/lucasb-eyer/pydensecrf

mcever commented 5 years ago

Just want to tag these on here as well:

1) run.sh line 10 has a hardcoded path that should be PASCAL_DIR 2) python-tk as a dependency, installed via apt-get