IMELE icon indicating copy to clipboard operation
IMELE copied to clipboard

cannot import name 'pytorch_ssim' from 'ssim'

Open MavrahShahid opened this issue 1 year ago • 4 comments

I was executing the code and faced this error can you please guide me on this because most of the solutions on different sites haven't worked for me. I am currently in utils.py. I have also installed ssim and pytorch_ssim in anaconda.

image

Any help will be highly appreciated!!

MavrahShahid avatar Jul 25 '23 12:07 MavrahShahid

I was executing the code and faced this error can you please guide me on this because most of the solutions on different sites haven't worked for me. I am currently in utils.py. I have also installed ssim and pytorch_ssim in anaconda.

image

Any help will be highly appreciated!!

I have also faced this problem at that time I dont want to add structural similarity error to compute so i commented it but the problem is related to python version which version you use? try to use python 3.6 or lower it will help you if you really want to compute structural similarity or read the documentation of ssim module.

Arham222 avatar Jul 26 '23 09:07 Arham222

Thank you for your response. The version which I am using is 3.9.12. But I will try it with the lower versions. Also I am facing the same issue with other libraries as well, torchvision and gdal, did you also happen to face the same issue. Kindly guide me through this. I would be highly appreciated.

MavrahShahid avatar Jul 26 '23 11:07 MavrahShahid

Hi maybe just don't use ssim for evaluation. It has been depreciated in the newer pytorch version

On Wed, 26 Jul 2023 at 12:27, MavrahShahid @.***> wrote:

Thank you for your response. The version which I am using is 3.9.12. But I will try it with the lower versions. Also I am facing the same issue with other libraries as well, torchvision and gdal, did you also happen to face the same issue. Kindly guide me through this. I would be highly appreciated.

— Reply to this email directly, view it on GitHub https://github.com/speed8928/IMELE/issues/15#issuecomment-1651603496, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGMH3KDIBY3ECLOLCV656TXSD5LPANCNFSM6AAAAAA2W75BZE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

speed8928 avatar Jul 26 '23 16:07 speed8928

If you are using vs code through anaconda or try to install it pip install gdal on python 3.9 version it will not be install you have to downgrade your python version. If you read the research paper it is published in 2020 as there is no requirement file so assuming the code was written in 2020 and published in 2021. I used python 3.6 version for installing gdal as I am using this code as a reference for my thesis and final year project for estimating building height for Pakistan. Try to make virtual environment and install python 3.6 version hopefully your all libraries issues will be solved.

Arham222 avatar Jul 26 '23 17:07 Arham222