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

fix requirements file (conflict and missing modules) #97

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MvWouden
Copy link

@MvWouden MvWouden commented Mar 6, 2023

Issue

The requirements file is missing some dependencies which are required to train the model or to preprocess custom data.

Changes

  1. Bumped numpy to version 1.19.3 to resolve dependency conflict
  2. Added module imageio
  3. Added module scikit-image
  4. Added module tensorboard
  5. Added these changes to the "dependencies" in the readme

Steps to reproduce

Installing code and running custom data preprocessing and model training, e.g.

# Clone the repository 
git clone https://github.com/Totoro97/NeuS.git
cd NeuS

# Check python version
python --version  # should be 3.9.X

# Create virtual env
python3 -m venv venv
source venv/bin/activate  # or venv\Scripts\active on windows

# Install correct PyTorch version
pip3 install torch==1.8.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html  # or another (1.8.0)

# Install requirements from file
pip3 install -r requirements.txt

# First issue with requirements file found here
#
# The conflict is caused by:
#     The user requested numpy==1.19.2
#     trimesh 3.9.8 depends on numpy
#     opencv-python 4.5.2.52 depends on numpy>=1.19.3
#
# Solved by bumping numpy to 1.19.3 (previously 1.19.2) and reinstalling dependencies

# Test run according to preprocess_custom_data at https://github.com/Totoro97/NeuS/tree/main/preprocess_custom_data#option-2-use-colmap
cd preprocess_custom_data/colmap_preprocess
python imgs2poses.py ${data_dir}

# Second issue with requirements file found here
#
# ... ModuleNotFoundError: No module named 'imageio'
#
# Solved by adding imageio to requirements file and reinstalling dependencies

# Test run according to preprocess_custom_data at https://github.com/Totoro97/NeuS/tree/main/preprocess_custom_data#option-2-use-colmap
python imgs2poses.py ${data_dir}

# Third issue with requirements file found here
#
# ... ModuleNotFoundError: No module named 'skimage'
#
# Solved by adding scikit-image to requirements file and reinstalling dependencies

# Test run according to preprocess_custom_data at https://github.com/Totoro97/NeuS/tree/main/preprocess_custom_data#option-2-use-colmap
python imgs2poses.py ${data_dir}  # Success now!

# Run training
cd ../..
python exp_runner.py --mode train --conf ./confs/womask.conf --case <case_name>

# Fourth issue with requirements file found here
#
# ... ModuleNotFoundError: No module named 'tensorboard'
#
# Solved by adding tensorboard to requirements file and reinstalling dependencies

# Run training
cd ../..
python exp_runner.py --mode train --conf ./confs/womask.conf --case <case_name>

@FlorentLM
Copy link

Hey there!

FWIW, while these changes worked for me on Linux, they did not on Windows 11 with CUDA 11.1 - Here is the requirements.txt that did it:

Using a python=3.7.16 environment,

--find-links https://download.pytorch.org/whl/torch_stable.html

trimesh==3.9.8
numpy==1.19.2
pyhocon==0.3.57
icecream==2.1.0
opencv_python==4.5.2.52
tqdm==4.50.2
torch==1.8.0+cu111
scipy==1.7.0
PyMCubes==0.1.2
imageio==2.31.1
scikit-image==0.19.3
tensorboard==2.11.2

@v4r4rth
Copy link

v4r4rth commented Jul 3, 2024

Can you please suggest a way to run this on Ubuntu 22.04.4 ? CUDA 11.1 is not supported for me so unsure which torch to get...

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

Successfully merging this pull request may close these issues.

3 participants