Open Krovatkin opened 3 months ago
Hi @Krovatkin ,
I have tested the code in colab and it seems working in coilab environment. The installed versions of torch
and keras
are 2.2.1+cu121
and 3.1.1
respectively. Please refer to attached gist.
@SuryanarayanaY did you change the runtime to T4?
I re-ran yr notebook and it crashed with the exact same error:
Hi @Krovatkin ,
Thanks for letting me know. I have checked with GPU runtime and its raising error as reported. Attached gist for reference. The error seems generated from torch library. Not sure whether this is issue with compatibility with Interface.
Escalating to Dev team for their review and comments.
The error seems generated from torch library
@SuryanarayanaY thank you very much for verifying the test!
The error seems generated from torch library
if you would like, I can provide the pytorch version of this test case which avoids this error.
Keras3's Functional moves the input back to a default device ("cuda:0" in this case) from "cpu" causing the error and Functional
isn't a torch class.
test
The following test that's supposed to run the model below on CPU rather than CUDA
error
errors out with the following error:
Env:
Expected Output
The expected behaviour is that the test runs without any errors and prints out an output tensor.
More details:
If I add a pre_forward hook to print out the devices of inputs and parameters I'm seeing that
Functional
seems to convert my CPU input back tocuda
device(type='cpu')]
->device='cuda:0'
so the firstDense
layer is seeing a cuda tensor.