Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got errors in pyramid_gaussian function #5

Closed
pz0910 opened this issue Jun 28, 2020 · 5 comments
Closed

Got errors in pyramid_gaussian function #5

pz0910 opened this issue Jun 28, 2020 · 5 comments

Comments

@pz0910
Copy link

pz0910 commented Jun 28, 2020

Got error :
pyramid = list(pyramid_gaussian(img, n_scales-1, multichannel=True))
File "/home/jsgx/.conda/envs/pytorch/lib/python3.6/site-packages/skimage/transform/pyramids.py", line 197, in pyramid_gaussian
image = img_as_float(image)
File "/home/jsgx/.conda/envs/pytorch/lib/python3.6/site-packages/skimage/util/dtype.py", line 378, in img_as_float64
return convert(image, np.float64, force_copy)
File "/home/jsgx/.conda/envs/pytorch/lib/python3.6/site-packages/skimage/util/dtype.py", line 244, in convert
raise ValueError("Images of type float must be between -1 and 1.")
ValueError: Images of type float must be between -1 and 1.

python main.py --n_GPUs 2 --batch_size 16
It seems image tensors have to be normlized to [-1,1]. Should I add --rgb_range=1 to solve this problem

@SeungjunNah
Copy link
Owner

@pz-AOE
Strange. Which version for scikit-image are you using?
I tested with scikit-image v0.16.2 and I always have [0, 255] input -> [0, 255] output for float32 type in the pyramid_gaussian function. This is as expected: see the image_as_float function description here.
--rgb_range 255 should not have any problems.

@pz0910
Copy link
Author

pz0910 commented Jun 29, 2020

@pz-AOE
Strange. Which version for scikit-image are you using?
I tested with scikit-image v0.16.2 and I always have [0, 255] input -> [0, 255] output for float32 type in the pyramid_gaussian function. This is as expected: see the image_as_float function description here.
--rgb_range 255 should not have any problems.

Thanks for replying.
I am using scikit-image v.014.0. I will try to upgrade the dependencies to check if it works.
By the way, could you please share your yaml env file?

@SeungjunNah
Copy link
Owner

My main conda environment is for multiple purposes and it includes many unrelated packages to this project.
Here are the versions I used for main dependencies.

imageio 2.8.0
numpy 1.18.1
matplotlib 3.2.1
tqdm 4.46.1
scikit-image 0.16.2
readline 8.0

If you want to create a new conda environment, the following would suffice.

conda install -y tqdm imageio scikit-image matplotlib readline
conda install -y pytorch torchvision cudatoolkit=10.2 -c pytorch

@pz0910
Copy link
Author

pz0910 commented Jun 30, 2020

Problem solved by upgrading scikit-image to v0.16.2.
Thanks

@pz0910 pz0910 closed this as completed Jun 30, 2020
@davidvct
Copy link

if you are using RTX 4090 like me, cuda 10.2 is not compatible with it.
I am using cuda 11.3, training seems to work (still ongoing).
installation of cuda 11.3:
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants