PLAI and CUDA

I train my network using PLAI and CUDA.
On final stage of Model Conversion I get the following error:

python3.6 ./PLAI.py
self.num_classes 2
self.mask_bits 3,3,1,1,1
==> Preparing data..
Training and validation data exist already
==> Building model from scratch..
Epoch: 0
[================================================================>] Step: 2s260ms | 66/66 s235ms | Loss: nan | Acc: 59.542% (312/524)20.000 | Acc: 52.143% (146/280)
[===========================================================>…] Step: 38 12/12 t: 428ms | Loss: nan | Acc: 62.500% (15/24))
Saving..

  • Saved checkpoint to ./checkpoint/gti_2801_gnet1.t7
    ==> Slicing network..
    ==> Absorbing batch normalization..
    Traceback (most recent call last):
    File “./PLAI.py”, line 150, in
    gtiPLAI.gtiModelConversion()
    File “./PLAI.py”, line 119, in gtiModelConversion
    modelConversion(self.model_type, self.module_type, self.mask_bits, self.checkpoint_dir, self.checkpoint, filter_out , bias_out, fc_out)
    File “/home/roland/_PLAI/modelConversion.py”, line 543, in modelConversion
    netSurgeryDumpType1(arch, checkpoint_mid, filter_out, bias_out, fc_out)
    File “/home/roland/_PLAI/modelConversion.py”, line 134, in netSurgeryDumpType1
    quant_gain = np.concatenate((quant_gain, np.array(quant.data)), axis=0)
    File “/home/roland/.local/lib/python3.6/site-packages/torch/tensor.py”, line 486, in array
    return self.numpy()
    TypeError: can’t convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

This link may help you: http://wiki.t-firefly.com/en/NCCS1/fqa.html#typeerror-can-t-convert-cuda-tensor-to-numpy-use-tensor-cpu-to-copy-the-tensor-to-host-memory-first