Code Monkey home page Code Monkey logo

Comments (13)

klutzzykitty avatar klutzzykitty commented on June 12, 2024 1

@ashutoshIITK
Thanks for that !
i'll first try to dig a little deeper and find a solution.
If it doesn't bear fruit, i'll be sure to contact you.

Would a Nvidia cuda docker have any issues with torchreid's working?

Regarding the trial to reproduce the error:
If possible, you can try with Nvidia cuda 11.3.1 docker : $docker pull nvcr.io/nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
and then continuing with the same instructions in this repo.

The only change in the install_packages_reid.sh script would be to install pytorch with environment respective cuda version i.e.
$conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch

install_packages_reid.sh can also be run as-is , which installs pytorch with cuda 11.7 instead.
(which I think shouldn't cause any issues as its backward compatible).

from vehiclereidentificationdataset.

klutzzykitty avatar klutzzykitty commented on June 12, 2024 1

@ashutoshIITK

Tried without docker, was limited to pytorch 1.9.0 with cuda 11.1
it's the same behaviour without docker as well.

Yeah, I suppose i'm pointing to the right path as well , have the image, query and gallery data directories inside CARLA_dataset folder. PATH_TO_DATASET = "/home/reid/CARLA_dataset/"

Noticed that the exit is triggered with cam_id = 81 every time with or without docker for which the car_id isn't fetched

=> Loading train (source) dataset
cam ID : 29
car ID : 5
cam ID : 21
car ID : 2
.
.
cam ID : 61
car ID : 29
cam ID : 32
car ID : 9
cam ID : 26
car ID : 38
cam ID : 81

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

This is within the elif dataset_type == "image_query": condition of VeRiDataset class.

The car and cam IDs for train and gallery folders load properly tho.

from vehiclereidentificationdataset.

klutzzykitty avatar klutzzykitty commented on June 12, 2024 1

@ashutoshIITK
Was away for a while.
Here are some of the findings.

  1. Saw that only one of the IDs is 0 based instead of both cam and car ID being 0 based (the latter is what I guess torchreid requires ).

  2. Removing the images causing the problem (in query) resulted in the repetition of the same problem till the last set of images remained. Thus the problem may not be associated with the path or naming but with handling of the data-structure.

  3. Re-wired a completely new logic for obtaining the train, gallery and query arrays in VeRiDataset class and re-arranged the gallery and query data in a different manner.

After this, re-id seems to be working on the shared carla vehicle dataset.
Verified it with test_only=True.

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty Thanks for detailed info. I was able to reproduce your error. You need to build the torchreid module from source because pip package does not support the latest version. The latest version is 1.4.0.

Hope it solves your issue. I will update the repository with installation script soon.

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
I have updated the installation instructions. Please check and let me know if the problem still persists.

from vehiclereidentificationdataset.

klutzzykitty avatar klutzzykitty commented on June 12, 2024

@ashutoshIITK Thanks for the quick response!

Ah, so a newer version of torchreid exists. That's something new I learnt.
Will try out the new changes you've mentioned and get back.

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
Yeah and you need to build it from the source.
Let me know if this is resolved.

from vehiclereidentificationdataset.

klutzzykitty avatar klutzzykitty commented on June 12, 2024

@ashutoshIITK

Damn, have the same error after executing the updated instructions : (

Also tried with python 3.7 and 3.9
pytorch-cuda=11.7 and 11.3 versions, but it's the same behaviour.

Some other methods I tried :
####################################################################################

  1. Have built torchreid from source
Installed /home/vehicle_reid_working/VehicleReIdentificationDataset/deep-person-reid
Processing dependencies for torchreid==1.4.0
.
.
.
Using /root/anaconda3/envs/carla_reid/lib/python3.7/site-packages
Finished processing dependencies for torchreid==1.4.0

>>> print(f"current torch-reid version: {torchreid.__version__}")
current torch-reid version: 1.4.0
>>> 
>>> torch.cuda.is_available()
True

the updated shell script has python setup.py install method which builds the torchreid module.
Tried with python setup.py develop as well, but both resulted in the same error.

  1. Combinations of python and pytorch-cuda versions
    python 3.7 with pytorch-1.13.1-cuda11.7 stable build and pytorch-1.12.1-cuda11.3
    python 3.9 with pytorch-1.13.1-cuda11.7 stable build and pytorch-1.12.1-cuda11.3

####################################################################################

System and package specs (if it comes in handy):
################################################
OS: ubuntu 20.04
GPU: Nvidia RTX 3090
CPU: Ryzen9 5950x
Conda: 23.1.0
CUDA: tried with both 11.7 and 11.3
################################################

pic for reference ( although it's not useful : ) )

torch_reid_error_2

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
Thanks! I am unable to reproduce this error now, but I am trying.

I can look it over a zoom call, if you want. My timezone is EST (Boston/NY).

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
Thanks! I tried the docker image and I do not get error in loading the dataset. I used python venv instead of conda, but that should not be the reason. Did you correctly load the host folder directory (containing images) to the docker container?

sudo docker run -it -v /home/mdxuser/Desktop/Ph.D/GitHub/VehicleReIdentificationDataset/:/VehicleReIdentificationDataset/ -p 8888:8888 f97a05a20604 /bin/bash

In above example, I just loaded the root directory of the repository, which also contains the dataset folder. In the Jupyter notebook, I only changed the PATH_TO_DATASET = "/VehicleReIdentificationDataset/dataset/".

With that, I was able to load the dataset successfully. Is that something you already tried and still getting the KeyError?

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
Also, could you try without Docker to see if that works or not? Of course, I can also share my Docker image.

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
Thanks! Could you try to do some try and except, for loading cam_id and car_id. In the Exception, you may try to print image (path or filename), so that we can know which file is causing the problem. Try removing that file and see if that helps catching the real problem.

from vehiclereidentificationdataset.

ashutoshIITK avatar ashutoshIITK commented on June 12, 2024

@klutzzykitty
Awesome! Thanks a lot for sharing the issue in detail. Glad that you are all set. Let me know if you have some other questions.

from vehiclereidentificationdataset.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.