Unexpected behavior

Hi,
i am trying to run inference with a CNN (retinanet in this case) and i see very unexpected behavior:

  • when running the network with bmp files everything works as expected
  • when running the network on a specific mp4 video i got the following crash for the second frame:
    File “/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/_functions.py”, line 54, in forward
    assert all(map(lambda i: i.is_cuda, inputs))
  • when i examine the errors i see that for the video i must run before the inference:
    os.environ[“CUDA_VISIBLE_DEVICES”] = device
    adding this line helps with the video while it is not needed at all with the images.
  • if i run this line:
    print(‘CUDA available: {}’.format(torch.cuda.is_available()))
    before the line mentioned above i get the same crash , but when i put it after the setting of cuda visible devices it runs ok.
    again this happens only for the video and not for the images.

when checking the image - it is h * w * 8 for the images and h * w * 24 for the video.

is there any reason why it fails to load always the second image?