Train an Object Detector with your own 'COCO' dataset in PyTorch

Raouf_Amrani: <p>Hi Guys,</p>
<p>I am pretty new using PyTorch, I have successfully trained Yolo object detector on coco dataset using PyTorch, but when i try to train on my custom dataset (coco format) i got this error</p>
<p>error</p>
<pre><code class="lang-auto">Traceback (most recent call last): File "main.py", line 470, in &lt;module&gt; main() File "main.py", line 356, in main for iter_i, (imgs, targets,img_info,idx) in enumerate(dataloader): File "/home/aa33915512/anaconda3/envs/pytorch/lib/python3.7/site-
packages/torch/utils/data/dataloader.py", line 637, in __next__ return self._process_next_batch(batch) File
 "/home/aa33915512/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch raise batch.exc_type(batch.exc_msg) KeyError: 'Traceback (most recent call last):\n
 File 
"/home/aa33915512/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/data/dataloader.py",
line 138, in _worker_loop\n samples = collate_fn([dataset[i] for i in batch_indices])\n File "/home/aa33915512/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 138, in &lt;listcomp&gt;\n samples =
collate_fn([dataset[i] for i in batch_indices])\n File "/home/aa33915512/ASFF/dataset/dataloading.py", line 65, in wrapper\n ret_val = getitem_fn(self, index)\n File "/home/aa33915512/ASFF/dataset/mixupdetection.py",
 line 49, in __getitem__\n img1, label1, _, _= self._dataset.pull_item(idx)\n File "/home/aa33915512/ASFF/dataset/cocodataset.py", line 61, in pull_item\n im_ann = 
self.coco.loadImgs(id_)[0]\n File "/home/aa33915512/anaconda3/envs/pytorch/lib/python3.7/site-packages/pycocotools/coco.py", line 230, in loadImgs\n return [self.imgs[id] for id in ids]\n
 File

 "/home/aa33915512/anaconda3/envs/pytorch/lib/python3.7/site-packages/pycocotools/coco.py", line 230, in &lt;listcomp&gt;\n return [self.imgs[id] for id in
 ids]\nKeyError: \'F\'\n'
</code></pre>
<p>Env:</p>
<pre><code class="lang-auto">PyTorch version: 1.0.1.post2
Is debug build: False
CUDA used to build PyTorch: 10.0.130
ROCM used to build PyTorch: N/A

OS: Ubuntu 21.04 (x86_64)
GCC version: (Ubuntu 6.4.0-17ubuntu1) 6.4.0 20180424
Clang version: Could not collect
CMake version: version 3.18.4
Libc version: glibc-2.17

Python version: 3.7 (64-bit runtime)
Python platform: Linux-5.11.0-18-generic-x86_64-with-debian-bullseye-sid
Is CUDA available: True
CUDA runtime version: 10.0.130
GPU models and configuration: 
GPU 0: TITAN RTX
GPU 1: GeForce GT 710

Nvidia driver version: 460.84
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] torch==1.2.0
[pip3] torchvision==0.4.0
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               10.0.130                      0  
[conda] mkl                       2020.2                      256    anaconda
[conda] mkl-service               2.3.0            py37he8ac12f_0  
[conda] mkl_fft                   1.3.0            py37h54f3939_0  
[conda] mkl_random                1.1.1            py37h0573a6f_0  
[conda] numpy                     1.19.2           py37h54aff64_0  
[conda] numpy-base                1.19.2           py37hfa32c7d_0  
[conda] pytorch                   1.0.1           py3.7_cuda10.0.130_cudnn7.4.2_2    pytorch
[conda] torch                     1.2.0                    pypi_0    pypi
[conda] torchvision               0.4.0                    pypi_0    pypi

</code></pre>
<p>Any suggestions ?</p>