Function_attributes(): after cudaFuncGetAttributes: an illegal memory access was encountered

pytorch 0.20
my code works well on PASCAL VOC dataset. However, when I change dataset to “Microsoft COCO”, it terminated:
terminate called after throwing an instance of 'thrust::system::system_error’
what(): function_attributes(): after cudaFuncGetAttributes: an illegal memory access was encountered
Aborted (core)

your code must have bugs, or maybe it is running out of memory.