google-research / maxim

[CVPR 2022 Oral] Official repository for "MAXIM: Multi-Axis MLP for Image Processing". SOTA for denoising, deblurring, deraining, dehazing, and enhancement.

Home Page:https://arxiv.org/abs/2201.02973

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem executing the run_eval.py command: So such file or directory. How to use the --ckpt_path argument properly?

deshwalmahesh opened this issue · comments

I think the Error is due to $ in --ckpt_path path. Can someone please give me an idea of where do I have to save the checkpoint file and run the command?

Hi
I downloaded the model checkpoints from the given link, rename and save it inside ckpt/adobe.npz. Now my directory looks like:

maxim/
    ckpt/
        adobe.npz
    maxim/
        images/
            Enhancement/
                input/
                    1.png
                    111.png
            Results/
                # EMPTY
        models/
            models.py
            __init__.py

        run_eval.py

I am inside parent maxim directory and when I run the command:

python3 maxim/run_eval.py --task Dehazing --ckpt_path ${ckpt/adobe.npz} \
  --input_dir maxim/images/Enhancement --output_dir maxim/images/Results --has_target=False

I get an error:

 File "maxim/run_eval.py", line 419, in <module>
    app.run(main)
  File "/home/mahesh/anaconda3/envs/py37/lib/python3.7/site-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/home/mahesh/anaconda3/envs/py37/lib/python3.7/site-packages/absl/app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "maxim/run_eval.py", line 327, in main
    filepath = sorted(os.listdir(os.path.join(FLAGS.input_dir, 'input')))
FileNotFoundError: [Errno 2] No such file or directory: 'maxim/images/Enhancement/input'

I tried changing the file location and every version of --ckpt_path like:

--ckpt_path $ {ckpt/adobe.npz}
--ckpt_path ckpt/adobe.npz
--ckpt_path $ {maxim/ckpt/adobe.npz} # Saving inside the child maxim module
--ckpt_path maxim/ckpt/adobe.npz

Only good thing I got there was that when not using the $, it showed no module named maxim which is due to the relative import.

Can you please help?

Hi, ${SIDD_CKPT_PATH} is just s placeholder that should be replaced with your stored ckpt path. In your case --ckpt_path ckpt/adobe.npz would work.

The other no module named maxim error is caused by having not installed the project. We would like to apologize for the imcomplete instructions. The full Installation should be:

  1. Install requirements:
pip install -r requirements.txt  
  1. setup project (what you missed):
pip install .   

After installed, you should be able to see results by running:

python3 maxim/run_eval.py --task Enhancement --ckpt_path ckpt/adobe.npz \
 --input_dir maxim/images/Enhancement --output_dir maxim/images/Results --has_target=False

Let me know if this works for your case.

Hi, ${SIDD_CKPT_PATH} is just s placeholder that should be replaced with your stored ckpt path. In your case --ckpt_path ckpt/adobe.npz would work.

The other no module named maxim error is caused by having not installed the project. We would like to apologize for the imcomplete instructions. The full Installation should be:

pip install -r requirements.txt  # Install requirements
pip install .   # setup project (**what you missed**)

After installed, you should be able to see results by running:

python3 maxim/run_eval.py --task Enhancement --ckpt_path ckpt/adobe.npz \
 --input_dir maxim/images/Enhancement --output_dir maxim/images/Results --has_target=False

Let me know if this works for your case.

Oh yes. thank you. I missed the install . part. I checked later the source code and you have used absl so I did build first and then install looking at the help arg. Thank you for your help.

@vztu Do you have any plan on releasing the train code too? Specially For RGB-RGB images?

Sorry we don't have any plans to release the training code recently. Our training pipeline is similar to common pipelines such as Basicsr