Closed pz0910 closed 4 years ago
@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.
@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 theimage_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?
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
Problem solved by upgrading scikit-image to v0.16.2. Thanks
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
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