DSRG icon indicating copy to clipboard operation
DSRG copied to clipboard

Training Issue likely from Version Conflicts

Open mcever opened this issue 7 years ago • 6 comments

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 avatar Jan 07 '19 19:01 mcever

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 avatar Jan 07 '19 21:01 mcever

Further, I had to pip install pyyaml and sklearn.

mcever avatar Jan 07 '19 21:01 mcever

@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.

speedinghzl avatar Jan 08 '19 06:01 speedinghzl

@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 avatar Jan 08 '19 17:01 mcever

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

mcever avatar Jan 08 '19 20:01 mcever

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

mcever avatar Jan 15 '19 21:01 mcever