liangjiandeng / DLPan-Toolbox

DLPan Toolbox for Pansharpening
GNU General Public License v3.0
138 stars 19 forks source link

Packages Import Issue #10

Closed UsamaShami11 closed 1 year ago

UsamaShami11 commented 1 year ago

Hello, I'm trying to implement and run the DLPAN-Toolbox, and have done the following steps to setup my environment: 1) Cloning the Repo and opening it via VSCode 2) Making a Conda Virtual Environment, with following packages: Python=3.8.15 | Pytorch=1.6.0 (cpu-only) | Torchvision=0.7 3) Running setup.py after installing the above Python/Pytorch versions

However, following issues have been observed: 1) Permission denied for wheel.exe upon running python setup.py develop , so I had to use python setup.py develop --user instead 2) Packages like nni, h5py are showing error *missing imports when ran run_panshapening.py, so I had to install them manually using these commands: conda install h5py pip install nni conda install regex

3) Now, when I run python run_pansharpening.py, mmcv is not being detected (image attached) and it is throwing the following error:

(DLPAN) D:\VS Code projects\01-DL-toolbox(Pytorch)\UDL\pansharpening>python run_pansharpening.py
Traceback (most recent call last):
  File "run_pansharpening.py", line 10, in <module>
    from UDL.AutoDL import TaskDispatcher
  File "d:\vs code projects\01-dl-toolbox(pytorch)\UDL\AutoDL\__init__.py", line 6, in <module>
    from UDL.Basis.python_sub_class import PanSharpeningModel, TaskDispatcher, ModelDispatcher
  File "d:\vs code projects\01-dl-toolbox(pytorch)\UDL\Basis\python_sub_class.py", line 7, in <module>
    from UDL.pansharpening.evaluation.ps_evaluate import analysis_accu, save_results
  File "d:\vs code projects\01-dl-toolbox(pytorch)\UDL\pansharpening\evaluation\ps_evaluate.py", line 11, in <module>
    from UDL.Basis.auxiliary import MetricLogger, SmoothedValue, set_random_seed
  File "d:\vs code projects\01-dl-toolbox(pytorch)\UDL\Basis\auxiliary\__init__.py", line 1, in <module>
    from ..auxiliary.utils import AverageMeter, accuracy, MetricLogger, SmoothedValue, set_random_seed, init_random_seed, show_memory_info
  File "d:\vs code projects\01-dl-toolbox(pytorch)\UDL\Basis\auxiliary\utils.py", line 8, in <module>
    import mmcv
ModuleNotFoundError: No module named 'mmcv'

Error

Kindly suggest the solution for such missing imports, as I tried installing mmcv from pip but it is being failed due to conflicts. Moreover, please mention the Python and Pytorch versions which you have used, so I may be able to replicate the results. Thanks!

UsamaShami11 commented 1 year ago

The above issues have been resolved, and brief details are as under:

Making another Conda Virtual Environment, with following packages: Python=3.8.15 | Pytorch=1.13.1 | Torchvision=0.14.1 | Pytorch-cuda = 11.7 | CUDA = 11.7.1

  1. python setup.py develop ran smoothly this time, but missing imports were to be installed as mentioned earlier.
  2. The issue regarding mmcv module is resolved by adjusting the folder paths in .py files where sys.path.append( ) function is used.