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

Resolved- Prepare Environment + omegaconf: Missing key pretty + No CUDA GPUs are available #47

Open
MinhasKamal opened this issue Jul 24, 2024 · 1 comment

Comments

@MinhasKamal
Copy link

MinhasKamal commented Jul 24, 2024

Hardware Requirements with GPU

OS: Linux (Instead of installing the latest version try with a slightly older one. Because, the latest version might not have support for CUDA. I worked with- Ubuntu 22.04)

GPU: 7GB+ for training classification model, 13GB+ for training segmentation model

Prepare Environment

Pre-requisites: Conda, CUDA

Run following commands:

// download the repo from github
wget https://github.com/qq456cvb/Point-Transformers/archive/refs/heads/master.zip
unzip master.zip
rm master.zip
cd Point-Transformers-master

// download the classification dataset
wget https://shapenet.cs.stanford.edu/media/modelnet40_normal_resampled.zip --no-check-certificate
unzip modelnet40_normal_resampled.zip
rm modelnet40_normal_resampled.zip

// download the segmentation dataset
mkdir data
cd data
wget https://shapenet.cs.stanford.edu/media/shapenetcore_partanno_segmentation_benchmark_v0_normal.zip --no-check-certificate
unzip shapenetcore_partanno_segmentation_benchmark_v0_normal.zip
rm shapenetcore_partanno_segmentation_benchmark_v0_normal.zip

// create new environment in conda 
conda create --name pt 
conda activate pt

// install dependency packages
conda install hydra-core
conda install tqdm
// get version info ‘nvcc --version’, ‘hostnamectl’, ‘nvidia-smi’ and generate installation command on- https://pytorch.org/ and run. The command might look like- conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

omegaconf.errors.ConfigAttributeError: Missing key pretty:

Inside the main() function of train_cls.py (line- 52), edit print(args.pretty()) to print(omegaconf.OmegaConf.to_yaml(args)).

pretty() is no longer supported in the newer version of omegaconf. That is why, we use to_yaml().

RuntimeError: No CUDA GPUs are available

Inside config/cls.yaml, edit gpu: 1 to gpu: 0.

Or, Inside the main() function of both train_cls.py (line- 49) and train_partseg.py (line- 50), comment out the line- os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu).

This issue might happen because you do not have a second GPU (you might ask ChatGPT for details). If your system has one GPU, then you do not need this line of code anyways.

AttributeError: module 'numpy' has no attribute 'float'

Inside train_partseg.py (line- 203), change dtype=np.float to dtype=float.

np.float is removed by the latest version of numpy.

Run code

python train_cls.py
// watch GPU usage with- watch -n 1 nvidia-smi

If you are using Putty to remotely train the models, then you can use Screen to run commands in the background.

@MinhasKamal
Copy link
Author

@qq456cvb If you see it fit, I can send you a pull requests with an updated code and instructions for setup.

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

1 participant