Borda / pyGCO

A python wrapper for gco-v3.0 package, used for graph cuts based MRF optimization.
http://vision.csd.uwo.ca/code
61 stars 18 forks source link

module 'gco' has no attribute 'GCO', 'cut_general_graph' #28

Closed MoZfi closed 1 year ago

MoZfi commented 1 year ago

hello, I have a problem putting the file on my local machine. first I downloaded all files in the repository and put in a folder as pyGCO. then I have changed the address of [gco-v3.0] for download in the makefile to the :https://vision.cs.uwaterloo.ca/files/gco-v3.0.zip. then I enter the pyGCO folder with terminal and run all these codes : make download make all make test_wrapper ./test_wrapper

and get the results as : labels = [ 0 2 2 1 ], energy=19 data energy=15, smooth energy=4

however when I run this code in the terminal: python3 test_examples.py

i got this error as well.

image

xiaodaxia007 commented 1 year ago

Did you fix this issue? I have the same problem.

MoZfi commented 1 year ago

yes, if you install the Pytorch with the conda version and then use the command as $ pip3 install gco-wrapper, all functions will be installed completely. remember the Python version should be 3.9.2 or more. if it does not solve the problem, create a virtual environment with conda package and python version3.9.2 and then install pytorch and finally gco-wrapper.

Borda commented 1 year ago

just did some minor fixes for numpy compatibility, you can try install from source:

pip install https://github.com/Borda/pyGCO/archive/refs/heads/master.zip

alter will be released as 3.0.9