guanghuixu / AnchorCaptioner

Other
32 stars 10 forks source link

Questions about the Pytorch version and cuda version #6

Closed wscffaa closed 2 years ago

wscffaa commented 2 years ago

First of all, I am glad that you open source such a good project, and then the following is the problem I encountered in reproducing the code:

I want to train the M4C-Captioner model on the TextCaps training set:

============================================================================

This is the command line I use: python tools/run.py --tasks captioning --datasets m4c_textcaps --model m4c_captioner \ --config configs/captioning/m4c_textcaps/m4c_captioner.yml \ --save_dir save/m4c_captioner \ training_parameters.data_parallel True

============================================================================

This is where I get errors when I train the code, can you please share your Pytorch version and cuda version? Overriding option training_parameters.data_parallel to True You have chosen to seed the training. This will turn on CUDNN deterministic setting which can slow down your training considerably! You may see unexpected behavior when restarting from checkpoints. /media/smartcity/E6AA1145AA1113A1/anaconda3/envs/textcap/lib/python3.8/site-packages/torch-1.9.1-py3.8-linux-x86_64.egg/torch/cuda/init.py:52: UserWarning: CUDA initialization: The NVIDIA driver on your system is too old (found version 10010). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:115.) return torch._C._cuda_getDeviceCount() > 0 WARNING: Device specified is 'cuda' but cuda is not present. Switching to CPU version Logging to: save/m4c_captioner/m4c_textcaps_m4c_captioner_2021/logs/m4c_textcaps_m4c_captioner_2021_2021-10-06T21:45:20.log

============================================================================

Here is the table of contents of my dataset:

data ├── m4c_coco │   ├── imdb_karpathy_test_filtered_by_image_id.npy │   ├── imdb_karpathy_test.npy │   ├── imdb_karpathy_train_filtered_by_image_id.npy │   ├── imdb_karpathy_train.npy │   ├── imdb_karpathy_val_filtered_by_image_id.npy │   ├── imdb_karpathy_val.npy │   ├── imdb_test2015_filtered_by_image_id.npy │   ├── imdb_test2015.npy │   ├── imdb_train2014_filtered_by_image_id.npy │   ├── imdb_train2014.npy │   ├── imdb_val2014_filtered_by_image_id.npy │   └── imdb_val2014.npy └── m4c_textcaps ├── imdb_test_filtered_by_image_id.npy ├── imdb_test.npy ├── imdb_train_filtered_by_image_id.npy ├── imdb_train_global_rule.npy ├── imdb_train.npy ├── imdb_val_filtered_by_image_id_global_rule.npy ├── imdb_val_filtered_by_image_id.npy └── imdb_val.npy

============================================================================

I placed the dataset data directory in the pythia directory,Is this correct?

├── pythia │   ├── common │   ├── data │   ├── datasets │   ├── init.py │   ├── legacy │   ├── models │   ├── modules │   ├── pycache │   ├── scripts │   ├── trainers │   └── utils

============================================================================

Here is my conda environment:

active environment : textcap active env location : /media/smartcity/E6AA1145AA1113A1/anaconda3/envs/textcap shell level : 2 user config file : /home/smartcity/.condarc populated config files : /home/smartcity/.condarc conda version : 4.10.3 conda-build version : 3.20.5 python version : 3.8.5.final.0 virtual packages : cuda=10.1=0 linux=4.15.0=0 glibc=2.23=0 unix=0=0 __archspec=1=x86_64 base environment : /media/smartcity/E6AA1145AA1113A1/anaconda3 (writable) conda av data dir : /media/smartcity/E6AA1145AA1113A1/anaconda3/etc/conda conda av metadata url : None channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch package cache : /media/smartcity/E6AA1145AA1113A1/anaconda3/pkgs /home/smartcity/.conda/pkgs envs directories : /media/smartcity/E6AA1145AA1113A1/anaconda3/envs /home/smartcity/.conda/envs platform : linux-64 user-agent : conda/4.10.3 requests/2.25.1 CPython/3.8.5 Linux/4.15.0-142-generic ubuntu/16.04.7 glibc/2.23 UID:GID : 1000:1000 netrc file : None offline mode : False

============================================================================

If you do not mind, I can communicate with you through WeChat, Thank you very much for your reply!

guanghuixu commented 2 years ago
  1. For the dataset, I guess you didn't download the object and OCR features. You only put the dataset annotations in the data dir. Please refer to TextCaps to prepare the object and OCR features.
  2. For the running environment, the version of Pytorch and CUDA will not significantly affect the reasoning results. You can simply install the latest PyTorch, and the corresponding CUDA drivers for your machine. Take my environment for example, cudatoolkit=10.2, Pytorch=1.7.1