Skip to content

HalfTensor (float16) support? tried to implement but failed :( #97

@arpitest

Description

@arpitest

Is it possible to run this with half precision, to be able to use higher image resolution with limited VRAM?
I've tried to do it (similar way to how stable diffusion does):

  • added "cnn=cnn.half()" after caling loadCaffemodel
  • replaced all FloatTensor by HalfTensor in neural_style.py
    It is running, but loss calculation is not working:

Running optimization with L-BFGS
Iteration 10 / 1000
Content 1 loss: nan
Style 1 loss: nan
Style 2 loss: nan
Style 3 loss: nan
Style 4 loss: nan
Style 5 loss: nan
Total loss: nan

any idea how to fix that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions