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

Simplify script without needing Docker #3

Open
SoftologyPro opened this issue Jun 23, 2024 · 3 comments
Open

Simplify script without needing Docker #3

SoftologyPro opened this issue Jun 23, 2024 · 3 comments

Comments

@SoftologyPro
Copy link

SoftologyPro commented Jun 23, 2024

I am trying to get this working under Windows without needing Docker. This should be possible right? Docker just complicates the setup. It should be create an environment, pip install the requirements, download models and go.

At this point I have a batch file to do all the setup and download the required models. This will get it all downloaded and setup on a Windows PC. Save this as install.bat into an empty directory and run it. For the downloads you also need wget.exe, 7z.ese and 7z.dll in the same directory.

@echo off

cd
echo *** Deleting EvTexture directory if it exists
if exist EvTexture\. rd /S /Q EvTexture

echo *** Cloning EvTexture repository
git clone https://github.com/DachunKai/EvTexture
cd EvTexture

echo *** Creating venv
python -m venv venv
call venv\scripts\activate.bat

echo *** Installing EvTexture requirements
python -m pip install --upgrade pip
pip install -r requirements.txt

echo *** Patching xformers
pip uninstall -y xformers
pip install --no-cache-dir --ignore-installed --force-reinstall --no-warn-conflicts xformers==0.0.25 --index-url https://download.pytorch.org/whl/cu118

echo *** Installing GPU torch
pip uninstall -y torch
pip uninstall -y torch
pip install --no-cache-dir --ignore-installed --force-reinstall --no-warn-conflicts torch==2.3.1+cu118 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

echo *** python setup.py develop
python setup.py develop

echo *** Downloading models
md experiments
md experiments\pretrained_models
md experiments\pretrained_models\EvTexture
..\wget "https://github.com/DachunKai/EvTexture/releases/download/v0.0/EvTexture_REDS_BIx4.pth" -O "experiments\pretrained_models\EvTexture\EvTexture_REDS_BIx4.pth" -nc
..\wget "https://github.com/DachunKai/EvTexture/releases/download/v0.0/EvTexture_Vimeo90K_BIx4.pth" -O "experiments\pretrained_models\EvTexture\EvTexture_Vimeo90K_BIx4.pth" -nc

echo *** Downloading test sets
..\wget "https://github.com/DachunKai/EvTexture/releases/download/v0.0/test_sets_REDS4_h5.zip" -O "datasets\test_sets_REDS4_h5.zip" -nc
..\wget "https://github.com/DachunKai/EvTexture/releases/download/v0.0/test_sets_Vid4_h5.zip" -O "datasets\test_sets_Vid4_h5.zip" -nc

echo *** Extracting test sets
cd datasets
..\..\7z x test_sets_REDS4_h5.zip
del test_sets_REDS4_h5.zip
..\..\7z x test_sets_Vid4_h5.zip
del test_sets_Vid4_h5.zip
cd..

call venv\scripts\deactivate.bat
cd..

echo *** Finished EvTexture install
echo.
echo *** Scroll up and check for errors.  Do not assume it worked.
pause

Then to run the examples, once the venv is activated I run either
python basicsr\test.py -opt options/test/EvTexture/test_EvTexture_Vid4_BIx4.yml --launcher pytorch
or
python basicsr\test.py -opt options/test/EvTexture/test_EvTexture_REDS4_BIx4.yml --launcher pytorch

At that point I get the following error.

  File "D:\Tests\EvTexture\EvTexture\basicsr\test.py", line 48, in <module>
    test_pipeline(root_path)
  File "D:\Tests\EvTexture\EvTexture\basicsr\test.py", line 16, in test_pipeline
    opt, _ = parse_options(root_path, is_train=False)
  File "d:\tests\evtexture\evtexture\basicsr\utils\options.py", line 122, in parse_options
    init_dist(args.launcher)
  File "d:\tests\evtexture\evtexture\basicsr\utils\dist_util.py", line 14, in init_dist
    _init_dist_pytorch(backend, **kwargs)
  File "d:\tests\evtexture\evtexture\basicsr\utils\dist_util.py", line 22, in _init_dist_pytorch
    rank = int(os.environ['RANK'])
  File "D:\Python\lib\os.py", line 680, in __getitem__
    raise KeyError(key) from None
KeyError: 'RANK'

Is it possible to get a simpler example with a script like
python upscale_video.py --source myvideo.mp4 --output upscaled.mp4 --other --options --here
so it is easier to get working without needing Docker?

Thanks for any help.

@DachunKai
Copy link
Owner

  1. First, our tests were conducted in a Linux (ubuntu 20.04) environment, not on Windows. For Windows users, we recommend using our published Docker image. When setting up the environment, we suggest using Conda. I noticed you're using the latest versions of Torch and Torchvision, which we haven't tested with. Our tested environment is:
    • Python 3.7 (Conda)
    • PyTorch 1.10.2+cu111 (pip)
    • torchvision 0.11.3+cu111 (pip)
    • BasicSR 1.4.2 (pip)
  2. Second, regarding the rank error, our test script is based on torch DDP, so you need to specify the number of GPUs, even if you have only one GPU.
  3. Third, thank you for your advice. Our current public code is to reproduce the results in our paper. Our model requires both video and event data as input. The event data can be generated by using an event simulator. We plan to simplify this process and provide a command for inference on user-provided videos for more practical use.

@SoftologyPro
Copy link
Author

OK, thanks. Even passing the GPUs as 1, ie
python -m torch.distributed.launch --nproc_per_node=1 --master_port=7860 basicsr/test.py -opt options/test/EvTexture/test_EvTexture_REDS4_BIx4.yml --launcher pytorch
gives a new showstopper error
W0623 19:29:15.340000 159152 torch\distributed\elastic\multiprocessing\redirects.py:27] NOTE: Redirects are currently not supported in Windows or MacOs.
So no go for Windows for now.
I will wait for the simplified updates. If you want a Windows tester, please ping me and I will do the Windows setup and testing for you :)

@Mikerhinos
Copy link

I'm also interested in a standard non docker solution if it can fit in 8GB VRAM :)

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