aleflabo / MoCoDAD

The official PyTorch implementation of the IEEE/CVF International Conference on Computer Vision (ICCV) '23 paper Multimodal Motion Conditioned Diffusion Model for Skeleton-based Video Anomaly Detection.
https://openaccess.thecvf.com/content/ICCV2023/html/Flaborea_Multimodal_Motion_Conditioned_Diffusion_Model_for_Skeleton-based_Video_Anomaly_Detection_ICCV_2023_paper.html
MIT License
64 stars 9 forks source link

Could you help me with error please? #7

Closed HuoQue closed 6 months ago

HuoQue commented 7 months ago

Dear author, since I am not familiar with the training steps, after downloading the UBnorma data set locally and using your readme file to train, I found the following error: (simclr) C:\Users\34252\Desktop\MoCoDAD-main>python train_MoCoDAD.py --config config/UBnormal/mocodad_train.yaml Namespace(config='config/UBnormal/mocodad_train.yaml') config/UBnormal/mocodad_train.yaml
Experiment directories created in ./checkpoints\UBnormal\train_experiment 'cp' is not an internal or external command, nor a runnable program Or batch files.
Seed set to 999
Traceback (most recent call last):
File "C:\Users\34252\Desktop\MoCoDAD-main\trainMoCoDAD.py", line 65, in
, trainloader, , val_loader = get_dataset_and_loader(args, split=args.split, validation=args.validation) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\34252\Desktop\MoCoDAD-main\utils\dataset.py", line 310, in get_dataset_and_loader
dataset = PoseDatasetRobust(path_to_data=args.data_dir,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\34252\Desktop\MoCoDAD-main\utils\dataset.py", line 223, in init
arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\34252.conda\envs\simclr\Lib\site-packages\numpy\lib\npyio.py", line 999, in _read arr = _load_from_filelike( ^^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'gbk' codec can't decode byte 0xc0 in position 51: illegal multibyte sequence I would like to know how to set up the data set structure if I only train on the ubnor data set and use the validation set to identify abnormal behavior.Looking forward to your early reply!I would be appreciated it!

aleflabo commented 7 months ago

Hi,

We tested MoCoDAD only in Linux environments. Looking at the path in your code, it seems you're using Windows and the paths you're using are not formatted in the proper way.

HuoQue commented 7 months ago

I am using the UBnormal data set, I am not very clear about the path of the UBnormal data set structure in the data directory, so I want to consult you about it.

aleflabo commented 7 months ago

Once you've downloaded the UBnormal dataset, you will find a README.md file, which includes the following dataset structure:

UBnormal
|
|__________ hr_bool_masks
|           |
|           |__________ testing
|           |           |
|           |           |__________ test_frame_mask
|           |                       |_______________{scene_id}_{clip_id}.npy
|           |                       |_______________...
|           |                       |_______________{scene_id}_{clip_id}.npy
|           |
|           |__________ validating
|                       |
|                       |__________ test_frame_mask
|                                   |_______________{scene_id}_{clip_id}.npy
|                                   |_______________...
|                                   |_______________{scene_id}_{clip_id}.npy
|
|__________ training
|           |
|           |__________ trajectories
|                       |
|                       |_________{scene_id}_{clip_id}
|                                 |
|                                 |_________00001.csv
|                                 |_________...
|                                 |_________0000{n}.csv
|
|__________ testing
|           |
|           |__________ trajectories
|           |           |
|           |           |_________{scene_id}_{clip_id}
|           |                     |
|           |                     |_________00001.csv
|           |                     |_________...
|           |                     |_________0000{n}.csv
|           |
|           |__________ test_frame_mask
|                       |
|                       |_______________{scene_id}_{clip_id}.npy
|                       |_______________...
|                       |_______________{scene_id}_{clip_id}.npy
|
|__________ validating
            |
            |__________ trajectories
            |           |
            |           |_________{scene_id}_{clip_id}
            |                     |
            |                     |_________00001.csv
            |                     |_________...
            |                     |_________0000{n}.csv
            |
            |__________ test_frame_mask
                        |
                        |_______________{scene_id}_{clip_id}.npy
                        |_______________...
                        |_______________{scene_id}_{clip_id}.npy

Using the config/UBnormal/mocodad_train.yaml to train MoCoDAD on UBnormal, the validation set is used by default. Set the validation parameter to false to disable it.

HuoQue commented 7 months ago

My computer had only one GPU and it had the following problem: File "C:\Users\34252.conda\envs\simclr\Lib\site-packages\torch\distributed\distributed_c10d.py", line 1302, in _new_process_group_helper raise RuntimeError("Distributed package doesn't have NCCL built in") RuntimeError: Distributed package doesn't have NCCL built in If you know how to solve this problem, I would really appreciate it! Thank you very much for your guidance these days.

aleflabo commented 7 months ago

This is something related to the environment you have and not related to the code. You can try to work in a Linux environment and see if the problem is solved.

You can check for the error online to solve it: https://discuss.pytorch.org/t/runtimeerror-distributed-package-doesnt-have-nccl-built-in/176744/3