Giter Site home page Giter Site logo

surajdonthi / multi-camera-person-re-identification Goto Github PK

View Code? Open in Web Editor NEW
176.0 4.0 36.0 1.53 MB

State-of-the-art model for person re-identification in Multi-camera Multi-Target Tracking. Benchmarked on Market-1501 and DukeMTMTC-reID datasets.

License: MIT License

Python 84.75% Jupyter Notebook 15.25%
computer-vision person-reidentification pytorch pytorch-lightning spatial-temporal convolutional-neural-networks multi-camera-tracking mtmct dukemtmc-reid market-1501

multi-camera-person-re-identification's Introduction

Multi-Camera Person Re-Identification

This repository is inspired by the paper Spatial-Temporal Reidentification (ST-ReID)[1]. The state-of-the-art for Person Re-identification tasks. This repository offers a flexible, and easy to understand clean implementation of the model architecture, training and evaluation.

This repository has been trained & tested on DukeMTMTC-reID and Market-1501 datasets. The model can be easily trained on any new datasets with a few tweaks to parse the files!

You can do a quick run on Google Colab: Open In Colab

Below are the metrics on the various datasets.

Model Size Dataset mAP CMC: Top1 CMC: Top5
resnet50-PCB+rerank Market 95.5 98.0 98.9
resnet50-PCB+rerank Duke 92.7 94.5 96.8

Model Architecture

MTMCT ST-ReID Model Architecture
Source: Spatial-Temporal Reidentification(ST-ReID)

  1. A pre-trained ResNet-50 backbone model with layers up until Adaptive Average Pooling(excluded) is used

During Training

  1. The last Convolutional layer is broken into 6 (Final output size: 6 x 1) parts and separately used for predicting the person label.
  2. The total loss of the 6 part predictions are calculated for backpropagation & weights update.

During Testing/Evaluation/Deployment

  1. Only the visual feature stream up until Adaptive Average Pooling is used.
  2. The feature vector of the query image is compared against all the feature vectors of the gallery images using a simple dot product & normalization.
  3. The Spatio-Temporal distribution is used to calculate their spatio-temporal scores.
  4. The joint score is then calculated from the feature score and the spatio-temporal scores.
  5. The Cumulated Matching Score is used to find the best matching for person from the gallet set.

Getting Started

Run the below commands in the shell.

  1. Clone this repo, cd into it & install setup.py:
git clone https://github.com/SurajDonthi/MTMCT-Person-Re-Identification

cd MTMCT-Person-Re-Identification

pip install -r requirements.txt
  1. Download the datasets. (By default you can download & unzip them to data/raw/ directory)

You can get started by training this model. Trained models will be available soon!

Dependencies

This project requires pytorch>=1.5.0, torchvision>=0.6.0, pytorch-lightning=1.1.1, tensorboard, joblib and other common packages like numpy, matplotlib and csv.

NOTE: This project uses pytorch-lightning which is a high-level interface to abstract away repeating Pytorch code. It helps achieve clean, & easy to maintain code with hardly any learning curve!

Train with your own dataset

Run the below command in the shell.

python -m mtmct_reid.train --data_dir path/to/dataset/ --dataset 'market' \
    --save_distribution path/to/dataset/st_distribution.pkl --gpus 1 --max_epochs 60

For a detailed list of arguments you can pass, refer to hparams.csv

Monitor the training on Tensorboard

Log files are created to track the training in a new folder logs. To monitor the training, run the below command in the shell

tensorboard --logdir logs/

Prediction/Evaluation

Using commandline:

python -m mtmct_reid.eval model_path 'path/to/model' --dataset 'market' \
    --query_data_dir 'path/to/query_data/' --gallery_data_dir 'path/to/gallery_data' \
    --st_distribution_path 'path/to/spatio-temporal_distribution' \
    --batch_size 64 --num_workers 4 --re_rank True

Metrics

The evaluation metrics used are mAP (mean Average Precision) & CMC (Cumulated Matching Characteristics)

Finding the best matches during testing:

Step 1: From a given dataset, compute it's Spatial-Temporal Distribution.

Requires: cam_ids, targets(labels), frames, MODEL is not required!

Step 2: Compute it's Gaussian smoothed ST-Distribution.

Requires: cam_ids, targets(labels), frames, MODEL is not required!

Step 3: Compute the L2-Normed features that is generated from the model.

Requires: Features - Performed once training is finished!

Step 4: Compute the Joint Scores.

Requires: Smoothed Distribution & L2-Normed Features, cam_ids, frames

Step 5: Optionally perform Re-ranking of the Generated scores.

Requires: Joint Scores

Step 6: Compute mAP & CMC (Cumulated Matching Characteristics; for Rank-1,Rank-5, Rank-10) for each query.

Requires: Reranked/Joint Scores, (query labels & cams), (gallery labels & cams)

References:

[1] - Spatial-Temporal Reidentification(ST-ReID)

[2] - Beyond Parts Models: Person Retrieval with Refined Part Pooling

Related repos:

The model logic is mainly based on this repository.

multi-camera-person-re-identification's People

Contributors

ai-deepak avatar dangho99 avatar dependabot[bot] avatar sramakrishnan247 avatar surajdonthi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multi-camera-person-re-identification's Issues

Enhancing Model Robustness for Cross-Dataset Generalisation in Multi-Camera Person Re-Identification

Dear Maintainers,

Firstly, I would like to extend my compliments on the remarkable work done with the Multi-Camera Person Re-Identification repository. The implementation of the ST-ReID model is both elegant and intuitive, providing a solid foundation for researchers and practitioners alike.

Having delved into the repository and the associated paper, I am particularly intrigued by the model's performance on the DukeMTMTC-reID and Market-1501 datasets. However, I am curious about the model's robustness and generalisation capabilities when applied to datasets with significant domain shifts or those captured in vastly different environmental conditions.

In the spirit of advancing the state-of-the-art and fostering a more resilient model, I propose the following points for discussion and potential enhancement:

  1. Domain Adaptation Strategies: Could you shed light on any strategies that might be in place or planned for future iterations to address domain adaptation? This is particularly pertinent for ensuring the model's efficacy across diverse datasets without substantial retraining.

  2. Cross-Dataset Evaluation: Has there been any evaluation of the model's performance on datasets not mentioned in the repository, such as CUHK03 or VIPeR? Insights into such evaluations would be invaluable for understanding the model's limitations and areas for improvement.

  3. Environmental Robustness: Are there any augmentations or techniques employed during training to enhance the model's robustness to environmental factors such as lighting variations, weather conditions, or occlusions?

  4. Feature Disentanglement: Considering the importance of spatial-temporal features in person re-identification, is there ongoing work to disentangle these features further to improve the distinctiveness of the model's representations?

I believe addressing these points could significantly bolster the model's utility in real-world applications where conditions are seldom as controlled as those in benchmark datasets. I look forward to your thoughts and any further insights you might provide on these matters.

Thank you for your time and consideration.

Best regards,
yihong1120

Useable code

Hey. I understand it's a new repo, but would it be too much to ask for the instructs and dataset to run the model? I just want to try it out. Maybe something for inference?
Thanks!

ModuleNotFoundError: No module named 'torchtext.legacy'

I run the demo code. installed all required libraries but got error

ModuleNotFoundError Traceback (most recent call last)
in <cell line: 5>()

  4 from pathlib import Path

----> 5 from pytorch_lightning import Trainer
6 from pytorch_lightning.callbacks.model_checkpoint import ModelCheckpoint
7 # from pytorch_lightning.profiler import AdvancedProfiler

/usr/local/lib/python3.8/site-packages/pytorch_lightning/utilities/apply_func.py in
27 if _TORCHTEXT_AVAILABLE:
28 if _compare_version("torchtext", operator.ge, "0.9.0"):
---> 29 from torchtext.legacy.data import Batch
30 else:
31 from torchtext.data import Batch

ModuleNotFoundError: No module named 'torchtext.legacy'

Unable to Reproduce: Training error

Hey,

I created a conda environment with python=3.6 and installed the packages in requirements.txt.
When I run the training command, I get the following:

$ python mtmct_reid/main.py --data_dir data/raw/Market-1501-v15.09.15 --save_distribution data/raw/Market-1501-v15.09.15/st_distribution.pkl --gpus 1 --max_epochs 1

Arguments: 
Namespace(accumulate_grad_batches=1, amp_backend='native', amp_level='O2', auto_lr_find=False, auto_scale_batch_size=False, auto_select_gpus=False, benchmark=False, check_val_every_n_epoch=1, checkpoint_callback=True, color_jitter=False, criterion='cross_entropy', data_dir='data/raw/Market-1501-v15.09.15', debug=None, default_root_dir=None, description=None, deterministic=False, distributed_backend=None, early_stop_callback=False, fast_dev_run=False, git_tag=None, gpus=1, gradient_clip_val=0, learning_rate=0.1, limit_test_batches=1.0, limit_train_batches=1.0, limit_val_batches=1.0, log_gpu_memory=None, log_path='./logs', log_save_interval=100, logger=True, max_epochs=1, max_steps=None, min_epochs=1, min_steps=None, num_nodes=1, num_processes=1, num_sanity_val_steps=2, num_workers=4, overfit_batches=0.0, overfit_pct=None, precision=32, prepare_data_per_node=True, process_position=0, profiler=None, progress_bar_refresh_rate=1, query_subdir='query', random_erasing=0.0, reload_dataloaders_every_epoch=False, replace_sampler_ddp=True, rerank=False, resume_from_checkpoint=None, row_log_interval=50, save_distribution='data/raw/Market-1501-v15.09.15/st_distribution.pkl', save_features=False, st_distribution=None, sync_batchnorm=False, terminate_on_nan=False, test_batchsize=16, test_percent_check=None, test_subdir='bounding_box_test', tpu_cores=<function Trainer._gpus_arg_default at 0x7fc86038ea60>, track_grad_norm=-1, train_batchsize=16, train_percent_check=None, train_subdir='bounding_box_train', truncated_bptt_steps=None, val_batchsize=16, val_check_interval=1.0, val_percent_check=None, weights_save_path=None, weights_summary='top')

/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/torchvision/transforms/transforms.py:258: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
  "Argument interpolation should be of type InterpolationMode instead of int. "


Generating Spatial-Temporal Distribution.



Saving distribution at data/raw/Market-1501-v15.09.15/st_distribution.pkl
GPU available: True, used: True
TPU available: False, using: 0 TPU cores
CUDA_VISIBLE_DEVICES: [0]
/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/utilities/distributed.py:37: UserWarning: Could not log computational graph since the `model.example_input_array` attribute is not set or `input_array` was not given
  warnings.warn(*args, **kwargs)

  | Name        | Type            | Params
------------------------------------------------
0 | model       | Sequential      | 23 M  
1 | dropout     | Dropout         | 0     
2 | classifier0 | ClassifierBlock | 718 K 
3 | classifier1 | ClassifierBlock | 718 K 
4 | classifier2 | ClassifierBlock | 718 K 
5 | classifier3 | ClassifierBlock | 718 K 
6 | classifier4 | ClassifierBlock | 718 K 
7 | classifier5 | ClassifierBlock | 718 K 
/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/utilities/distributed.py:37: UserWarning: Your val_dataloader has `shuffle=True`, it is best practice to turn this off for validation and test dataloaders.
  warnings.warn(*args, **kwargs)
Validation sanity check: 0it [00:00, ?it/s]Traceback (most recent call last):
  File "mtmct_reid/main.py", line 57, in <module>
    main(args)
  File "mtmct_reid/main.py", line 43, in main
    trainer.fit(model, data_module)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
    result = fn(self, *args, **kwargs)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1073, in fit
    results = self.accelerator_backend.train(model)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/accelerators/gpu_backend.py", line 51, in train
    results = self.trainer.run_pretrain_routine(model)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1224, in run_pretrain_routine
    self._run_sanity_check(ref_model, model)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/trainer/trainer.py", line 1257, in _run_sanity_check
    eval_results = self._evaluate(model, self.val_dataloaders, max_batches, False)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 333, in _evaluate
    output = self.evaluation_forward(model, batch, batch_idx, dataloader_idx, test_mode)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 687, in evaluation_forward
    output = model.validation_step(*args)
  File "/mnt/ssd/sramakrishnan/tracking/Multi-Camera-Person-Re-Identification/mtmct_reid/engine.py", line 173, in validation_step
    self.log_dict(self.val_logs, logger=False)
  File "/home/mli/sramakrishnan/miniconda3/envs/streid/lib/python3.6/site-packages/torch/nn/modules/module.py", line 948, in __getattr__
    type(self).__name__, name))
AttributeError: 'ST_ReID' object has no attribute 'log_dict'

Please let me know if there is something that I am missing.

When i tried to run using colab: Error: 'Path 'data/raw/Market-1501-v15.09.15' does not exist!


Exception Traceback (most recent call last)
in ()
16 )
17
---> 18 data_module = ReIDDataModule.from_argparse_args(args)
19
20 model = ST_ReID(data_module.num_classes, learning_rate=args.learning_rate,

2 frames
/content/MTMCT-Person-Re-Identification/mtmct_reid/data.py in init(self, data_dir, st_distribution, train_subdir, test_subdir, query_subdir, train_batchsize, val_batchsize, test_batchsize, num_workers, random_erasing, color_jitter, save_distribution)
114 if not self.data_dir.exists():
115 raise Exception(
--> 116 f"'Path '{self.data_dir.str()}' does not exist!")
117 if not self.data_dir.is_dir():
118 raise Exception(

Exception: 'Path 'data/raw/Market-1501-v15.09.15' does not exist!

training error (training on Market-1501)

Hi I am facing the following error while training. Do you know what this might be about?
I have checked all the package versions. Also, I think this happens in one particular batch that is passed during the training.

/opt/conda/conda-bld/pytorch_1595629403081/work/aten/src/THCUNN/ClassNLLCriterion.cu:108: cunn_ClassNLLCriterion_updateOutput_kernel: block: [0,0,0], thread: [15,0,0] Assertion `t >= 0 && t < n_classes` failed.
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1595629403081/work/aten/src/THCUNN/generic/ClassNLLCriterion.cu line=118 error=710 : device-side assert triggered
Traceback (most recent call last):
  File "mtmct_reid/main.py", line 56, in <module>
    main(args)
  File "mtmct_reid/main.py", line 42, in main
    trainer.fit(model, data_module) 
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/states.py", line 48, in wrapped_fn
    result = fn(self, *args, **kwargs)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1073, in fit
    results = self.accelerator_backend.train(model)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/accelerators/gpu_backend.py", line 51, in train
    results = self.trainer.run_pretrain_routine(model)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1239, in run_pretrain_routine
    self.train()
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/training_loop.py", line 394, in train
    self.run_training_epoch()
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/training_loop.py", line 516, in run_training_epoch
    self.run_evaluation(test_mode=False)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 582, in run_evaluation
    eval_results = self._evaluate(self.model, dataloaders, max_batches, test_mode)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 333, in _evaluate
    output = self.evaluation_forward(model, batch, batch_idx, dataloader_idx, test_mode)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 687, in evaluation_forward
    output = model.validation_step(*args)
  File "/NAS/project01/rzimmerm_substitles/rzm_s_toshal/MTMCT-Person-Re-Identification/mtmct_reid/engine.py", line 162, in validation_step
    loss, acc = self.eval_shared_step(batch, batch_idx, dataloader_idx)
  File "/NAS/project01/rzimmerm_substitles/rzm_s_toshal/MTMCT-Person-Re-Identification/mtmct_reid/engine.py", line 113, in eval_shared_step
    loss, acc = self.shared_step(batch, batch_idx)
  File "/NAS/project01/rzimmerm_substitles/rzm_s_toshal/MTMCT-Person-Re-Identification/mtmct_reid/engine.py", line 78, in shared_step
    loss += self.criterion(part, y)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/torch/nn/functional.py", line 2422, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
  File "/NAS/home01/toshal/anaconda3/envs/myenv/lib/python3.7/site-packages/torch/nn/functional.py", line 2218, in nll_loss
    ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
RuntimeError: cuda runtime error (710) : device-side assert triggered at /opt/conda/conda-bld/pytorch_1595629403081/work/aten/src/THCUNN/generic/ClassNLLCriterion.cu:118

AttributeError: 'list' object has no attribute 'add_figure'

AttributeError Traceback (most recent call last)
in ()
1 # Testing the loss & accuracy of the model
----> 2 trainer.test(model)

10 frames
/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py in test(self, model, test_dataloaders, ckpt_path, verbose, datamodule)
912
913 if model is not None:
--> 914 results = self.__test_given_model(model, test_dataloaders)
915 else:
916 results = self.__test_using_best_weights(ckpt_path, test_dataloaders)

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py in __test_given_model(self, model, test_dataloaders)
972 # run test
973 # sets up testing so we short circuit to eval
--> 974 results = self.fit(model)
975
976 # teardown

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py in fit(self, model, train_dataloader, val_dataloaders, datamodule)
497
498 # dispath start_training or start_testing or start_predicting
--> 499 self.dispatch()
500
501 # plugin will finalized fitting (e.g. ddp_spawn will load trained model)

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py in dispatch(self)
538 def dispatch(self):
539 if self.testing:
--> 540 self.accelerator.start_testing(self)
541
542 elif self.predicting:

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/accelerators/accelerator.py in start_testing(self, trainer)
74
75 def start_testing(self, trainer):
---> 76 self.training_type_plugin.start_testing(trainer)
77
78 def start_predicting(self, trainer):

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/plugins/training_type/training_type_plugin.py in start_testing(self, trainer)
116 def start_testing(self, trainer: 'Trainer') -> None:
117 # double dispatch to initiate the test loop
--> 118 self._results = trainer.run_test()
119
120 def start_predicting(self, trainer: 'Trainer') -> None:

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py in run_test(self)
785 # self.reset_test_dataloader(ref_model)
786 with self.profiler.profile("run_test_evaluation"):
--> 787 eval_loop_results, _ = self.run_evaluation()
788
789 if len(eval_loop_results) == 0:

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/trainer.py in run_evaluation(self, max_batches, on_epoch)
740
741 # lightning module method
--> 742 deprecated_eval_results = self.evaluation_loop.evaluation_epoch_end()
743
744 # hook

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/evaluation_loop.py in evaluation_epoch_end(self)
187
188 # call the model epoch end
--> 189 deprecated_results = self.__run_eval_epoch_end(self.num_dataloaders)
190
191 # enable returning anything

/usr/local/lib/python3.7/dist-packages/pytorch_lightning/trainer/evaluation_loop.py in __run_eval_epoch_end(self, num_dataloaders)
219 if is_overridden('test_epoch_end', model=model):
220 model._current_fx_name = 'test_epoch_end'
--> 221 eval_results = model.test_epoch_end(eval_results)
222 user_reduced = True
223

/content/MTMCT-Person-Re-Identification/mtmct_reid/engine.py in test_epoch_end(self, outputs)
199 fig = plot_distributions(self.trainer.datamodule.st_distribution)
200
--> 201 self.logger.experiment.add_figure('Spatial-Temporal Distribution',
202 fig)
203

Error in running mtmct_reid.train

Hello! I am interested in trying out this repository however I have encountered some problems in getting the training code to run.

Running this CLI: python -m mtmct_reid.train --data_dir data/raw/Market-1501-v15.09.15 --save_distribution st_distribution/st_distribution.pkl --gpus 1 --max_epochs 60

this is the error that I have received, which i think might be due to torchtext version issue? I am not very sure. Could you advise me on what I should do?
Traceback (most recent call last):
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/default/Desktop/eric/MTMCT-Person-Re-Identification/mtmct_reid/train.py", line 5, in
from pytorch_lightning import Trainer
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/init.py", line 30, in
from pytorch_lightning.callbacks import Callback # noqa: E402
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/callbacks/init.py", line 14, in
from pytorch_lightning.callbacks.base import Callback
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/callbacks/base.py", line 25, in
from pytorch_lightning.utilities.types import STEP_OUTPUT
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/utilities/init.py", line 18, in
from pytorch_lightning.utilities.apply_func import move_data_to_device # noqa: F401
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/utilities/apply_func.py", line 29, in
from pytorch_lightning.utilities.imports import _compare_version, _TORCHTEXT_LEGACY
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/utilities/imports.py", line 116, in
_TORCHTEXT_LEGACY: bool = _TORCHTEXT_AVAILABLE and _compare_version("torchtext", operator.lt, "0.11.0")
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/pytorch_lightning/utilities/imports.py", line 69, in _compare_version
pkg = importlib.import_module(package)
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/torchtext/init.py", line 40, in
_init_extension()
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/torchtext/init.py", line 36, in _init_extension
torch.ops.load_library(ext_specs.origin)
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/torch/_ops.py", line 933, in load_library
ctypes.CDLL(path)
File "/home/default/miniconda3/envs/multicam1/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: /home/default/miniconda3/envs/multicam1/lib/python3.8/site-packages/torchtext/_torchtext.so: undefined symbol: _ZNK3c104Type14isSubtypeOfExtESt10shared_ptrIS0_EPSo

The following are my pip list
Package Version


absl-py 2.1.0
aiohttp 3.9.3
aiosignal 1.3.1
async-timeout 4.0.3
attrs 23.2.0
cachetools 4.2.4
certifi 2024.2.2
charset-normalizer 3.3.2
contourpy 1.1.1
cycler 0.12.1
dataclasses 0.6
filelock 3.13.1
fonttools 4.50.0
frozenlist 1.4.1
fsspec 2024.3.1
future 1.0.0
google-auth 1.35.0
google-auth-oauthlib 0.4.6
grpcio 1.62.1
idna 3.6
imageio 2.34.0
importlib_metadata 7.0.2
importlib_resources 6.3.1
Jinja2 3.1.3
joblib 1.3.2
kiwisolver 1.4.5
lightning-utilities 0.11.0
Markdown 3.6
MarkupSafe 2.1.5
matplotlib 3.7.5
mpmath 1.3.0
multidict 6.0.5
networkx 3.1
numpy 1.24.4
nvidia-cublas-cu12 12.1.3.1
nvidia-cuda-cupti-cu12 12.1.105
nvidia-cuda-nvrtc-cu12 12.1.105
nvidia-cuda-runtime-cu12 12.1.105
nvidia-cudnn-cu12 8.9.2.26
nvidia-cufft-cu12 11.0.2.54
nvidia-curand-cu12 10.3.2.106
nvidia-cusolver-cu12 11.4.5.107
nvidia-cusparse-cu12 12.1.0.106
nvidia-nccl-cu12 2.19.3
nvidia-nvjitlink-cu12 12.4.99
nvidia-nvtx-cu12 12.1.105
oauthlib 3.2.2
packaging 24.0
pandas 2.0.3
pillow 10.2.0
pip 23.3.1
protobuf 3.20.3
pyasn1 0.5.1
pyasn1-modules 0.3.0
pyDeprecate 0.3.2
pyparsing 3.1.2
python-dateutil 2.9.0.post0
pytorch-lightning 1.6.0
pytz 2024.1
PyYAML 6.0.1
requests 2.31.0
requests-oauthlib 1.4.0
rsa 4.9
setuptools 68.2.2
six 1.16.0
sympy 1.12
tensorboard 2.2.0
tensorboard-plugin-wit 1.8.1
test-tube 0.7.5
torch 2.2.1
torchdata 0.7.0
torchmetrics 1.3.2
torchtext 0.8.0
torchvision 0.17.1
tqdm 4.66.2
triton 2.2.0
typing_extensions 4.10.0
tzdata 2024.1
urllib3 2.2.1
Werkzeug 3.0.1
wheel 0.41.2
yarl 1.9.4
zipp 3.18.1

How to query?

Could you share the code to query on a single image?
I cannot understand how exactly the data is being fed into the model.

Error running Colab notebook - 5th block of code

Generating Spatial-Temporal Distribution.

Downloading: "https://download.pytorch.org/models/resnet50-19c8e357.pth" to /root/.cache/torch/hub/checkpoints/resnet50-19c8e357.pth
100%
97.8M/97.8M [00:15<00:00, 6.82MB/s]

GPU available: True, used: True
TPU available: False, using: 0 TPU cores
CUDA_VISIBLE_DEVICES: [0]
Using native 16bit precision.

| Name | Type | Params

0 | model | Sequential | 23 M
1 | dropout | Dropout | 0
2 | classifier0 | ClassifierBlock | 718 K
3 | classifier1 | ClassifierBlock | 718 K
4 | classifier2 | ClassifierBlock | 718 K
5 | classifier3 | ClassifierBlock | 718 K
6 | classifier4 | ClassifierBlock | 718 K
7 | classifier5 | ClassifierBlock | 718 K

AttributeError Traceback (most recent call last)
in ()
26
27 #
---> 28 trainer.fit(model, data_module)
29
30 # Testing the loss & accuracy of the model

8 frames
/content/MTMCT-Person-Re-Identification/mtmct_reid/data.py in val_dataloader(self)
214
215 def val_dataloader(self):
--> 216 test_loader = DataLoader(self.test, batch_size=self.test_batchsize,
217 shuffle=False, num_workers=self.num_workers,
218 pin_memory=True)

AttributeError: 'ReIDDataModule' object has no attribute 'test'

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.