-
Notifications
You must be signed in to change notification settings - Fork 18
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
python scripts/get_labels.py --source ./ABSK #21
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @y1b2h3, to use on an animal dataset, you should first generate the animal parsing labels for your animal dataset using a Pifpaf model trained on another dataset with similar animals (or the same dataset). You should use that animal PifPaf model within the script provided by @samihormi (have a look at the README). You can also create the parsing labels using any other strategies, for instance using SAM or even doing it manually. Then you should create a Torchreid dataset class for your new dataset by replicating what was done for the other ReID datasets (you can have a look at how it's done for OccludedDuke in 'torchreid/data/datasets/image/occluded_dukemtmc.py' for instance). |
Hi @y1b2h3, you can try to run a training with an existing dataset to see how it works, and then create your own subclass of "torchreid/data/datasets/dataset.py" by mimicking what is done in 'torchreid/data/datasets/image/occluded_dukemtmc.py' for instance. Then you should register your dataset in "torchreid/data/datasets/init.py". Then in the yaml config you can choose your dataset as source and target: |
@y1b2h3 |
Hello, friend: => Start training |
Hi @y1b2h3, the purpose of the collate.py (where you have the error), is to process the output of the dataloader: this error means there's something wrong with the data returned by the dataloader, when building the training batch. The data returned by the dataloader and processed by the collate function comes from the getitem(...) function here: "torchreid.data.datasets.dataset.ImageDataset.getitem(...)". If you want to solve that error, you have to analyse all the data inside the "sample" object returned by this get_item function and understand what is causing the error: maybe you have an empty array, a wrong data type, or anything else |
This comment was marked as abuse.
This comment was marked as abuse.
@gao1qiang Give me your email. I would like to share my code and solve your problem. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
Hi @ellzeycunha0 , I have the same issue of "ValueError: not enough values to unpack (expected 2, got 0)". Could you please share your code to help me solve the problem? |
Hello, author; Can you help me solve this problem?
(bpbreid1) D:\downloads\bpbreid-main>python scripts/get_labels.py --source ./ABSK
Processing: 0batch [00:00, ?batch/s]
Processing: 0%| | 0/130 [00:00<?, ?batch/s]D
:\Anaconda\envs\bpbreid1\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ..\aten\src\ATen\native\TensorShape.cpp:3191.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Processing: 2%|████ | 3/130 [04:35<3:15:13, 92.23s/batch]Traceback (most recent call last):
File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 521, in
main()
File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 517, in main
mask_model(imagery=img_paths, dataset_dir=args.source, is_overwrite=False)
File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 392, in call
pifpaf_filtered: List[np.ndarray] = self.__filter_pifpaf_with_mask(batch, pifpaf_file_paths)
File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 475, in __filter_pifpaf_with_mask
masks = filter_masks(self.model(batch))
File "D:\downloads\bpbreid-main\scripts\get_labels.py", line 444, in filter_masks
filtered_boxes, filtered_masks = zip(
ValueError: not enough values to unpack (expected 2, got 0)
Processing: 2%|████ 3/130 [06:06<4:18:55, 122.32s/batch]
The text was updated successfully, but these errors were encountered: