cudnn.torch icon indicating copy to clipboard operation
cudnn.torch copied to clipboard

Is it possible to convert a GPU pre-trained model to CPU without cudnn?

Open shamangary opened this issue 8 years ago • 6 comments

Since the limited computer resource, I only have a CPU-only computer. However, some pre-trained model is based on GPU.

It seems that the torch installation will not contain cudnn when you don't have GPU on your computer. Therefore, I have no cudnn class in my torch. Moreover, there is no cudnn to nn conversion in the README.md.

Is there a way to convert a GPU pre-trained model to a CPU pre-trained model without using cudnn.torch?

shamangary avatar Mar 29 '16 00:03 shamangary

cudnn.convert(model, nn) works fine at least when you have gpu.

notimesea avatar Apr 07 '16 00:04 notimesea

We have observed that converting using cudnn.convert doesn't work for all modules, for example cudnn.ClippedReLU doesn't get translated into nn despite mention of API compatibility.

adroit91 avatar Jul 18 '16 03:07 adroit91

cudnn.TemporalConvolution is also not converted, since it's a wrapper on cudnn.SpatialConvolution.

roywei avatar Jul 19 '16 09:07 roywei

Hi could you find a way?

Thanks, Mina

Mina1368 avatar Nov 08 '16 23:11 Mina1368

@notimesea Does the cudnn.convert() method work if we convert a GPU-based model to a CPU-based model using a machine which has GPU support and then load this converted model on a CPU-only machine?

NightFury13 avatar Mar 05 '17 10:03 NightFury13

@soumith, please help. I'm having the same error. I don't know why when I call graph.dot(final_model.fg, 'model', 'model') torch crashes.

abarya avatar Jul 21 '17 18:07 abarya