Changing memory maximum limit to higher then 10%

Hello, I am trying to use TensorFlow on an AWS ec2 instance. I am using Google’s universal sentence encoder, which is around 1 Gb in size. My ec2 instance has 2Gb of ram I am trying to avoid upping the ram to avoid increasing my costs. At the moment, I just have a small docker image running on the server. How do I go about increasing the max memory usage, I am okay with the fact that it may cause issues and am prepared to increase the overall RAM if necessary but I would prefer to try it this way first.

I am currently using hub.load( ‘TensorFlow Hub’) but can go to hub.keraslayer that would use less RAM

Hi Reilly, welcome to the TensorFlow Forum!!!

can you tell me which model specifically you’re planning on use?

Usually, if you want to use less memory, you’d need to optimise the model to use less memory, like doing something like distillation (Knowledge Distillation)

You can also try quantizing the model (Quantification post-formation  |  TensorFlow Lite)

you can also use a smaller model

but there’s no special parameter on the library to do that automatically.

hope it helps