Closed philleer closed 5 years ago
If you notice, I was on version 0.9.3
and you're on 0.14.2
for the scikit-image
package. The module (skimage
) moved the submodule filter
elsewhere in a later version. You could either change the import line in the intrinsic
code to grab the new version of the filter, or you could downgrade your scikit-image
package (or you could set up a Python virtual env and use the exact same versions there).
It looks like for version 0.14.*
, it's now in restoration
rather than filter
: https://scikit-image.org/docs/0.14.x/api/skimage.restoration.html?highlight=denoise_bilateral#skimage.restoration.denoise_bilateral. I don't know if they also changed the implementation of the filter, you'd have to check that across versions.
Yes, you're totally right. Shortly after I opened this issue, I have tried to downgrade all my package to your suggested version or similar to it.
Here is it
>>> Python 3.5.2 (default, Nov 12 2018, 13:43:14)
>>> [GCC 5.4.0 20160609] on linux
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import scipy
>>> import skimage
>>> import sklearn
>>> import PIL
>>> numpy.__version__
'1.8.2'
>>> scipy.__version__
'1.0.0'
>>> skimage.__version__
'0.9.3'
>>> sklearn.__version__
'0.19.0'
>>> PIL.__version__
'6.0.0'
And for python3, there are something different from python2, such as
cPickle is for python2, while pickle is for python3
range and xrange are two keyword in python2, while they are united into range
Meanwhile, I also encountered the Unicode Decode Error
According to the traceback, the error date back to this line of file "bell2014/energy/prob_abs_r.py"
self.density = pk.load(gzip.open(data_filename, "rb"))
Traceback (most recent call last):
File "bell2014/decompose.py", line 125, in <module>
solver = IntrinsicSolver(input, params)
File "/home/cv/mycode/github/intrinsic_test/bell2014/solver.py", line 26,in __init__
self.energy = IntrinsicEnergy(self.input, params)
File "/home/cv/mycode/github/intrinsic_test/bell2014/energy/energy.py", line 14, in __init__
self.prob_abs_r = ProbAbsoluteReflectance(params)
File "/home/cv/mycode/github/intrinsic_test/bell2014/energy/prob_abs_r.py", line 16, in __init__
self._load()
File "/home/cv/mycode/github/intrinsic_test/bell2014/energy/prob_abs_r.py", line 66, in _load
self.density = pk.load(gzip.open(data_filename, "rb"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfe in position 0: ordinal not in range(128)
Seems like codec issue, so I first tried utf-8
f = gzip.open(data_filename, "rb")
self.density = pk.load(f, encoding='utf-8')
f.close()
Still error but something different
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte
Then I tried iso-8859-1
f = gzip.open(data_filename, "rb")
self.density = pk.load(f, encoding='iso-8859-1')
f.close()
All right, it is ok now. ( Though I dont know the cause of it, is it due to my ubuntu system configuration or something else such as terminal decoder? ) Anyway, it works well finally.
Still much thx to your reply.
After git clone the repo from the github I have install the dependecies as the instruction And I also compile it successfully But when I tried to run the script I got such error
Here is my system configuration
So what should I do to make it work? Have anyone encountered such problem? Any help is much appreciated. Thx very much!