0

I'm using C# with ML.NET to create an image classification thing. It works fine but when I run the code on a Linux VM (with only 0.6GB memory) I sometimes get this error when the model is used to predict an image.

2019-12-23 10:58:01.912720: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-12-23 10:58:02.511549: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz
2019-12-23 10:58:02.513308: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f096cb2ff80 executing computations on platform Host. Devices:
2019-12-23 10:58:02.513353: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2019-12-23 10:58:04.094413: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
2019-12-23 10:58:04.212846: W tensorflow/core/framework/allocator.cc:107] Allocation of 8576064 exceeds 10% of system memory.
2019-12-23 10:58:04.295982: W tensorflow/core/framework/allocator.cc:107] Allocation of 8388608 exceeds 10% of system memory.
2019-12-23 10:58:04.301122: W tensorflow/core/framework/allocator.cc:107] Allocation of 9437184 exceeds 10% of system memory.
2019-12-23 10:58:04.305958: W tensorflow/core/framework/allocator.cc:107] Allocation of 9437184 exceeds 10% of system memory.
2019-12-23 10:58:04.310375: W tensorflow/core/framework/allocator.cc:107] Allocation of 9437184 exceeds 10% of system memory.

Other times the screen simply terminates with no error message.

I've looked at other questions about this and have found that it's recommended to lower the batch_size to a small number, but I can't find where this is set.

Where can I edit this value?

230Daniel
  • 432
  • 3
  • 16
  • I am no expert. But image classification with only 0.6GB ram sounds really really low :D I couldn't find anything on https://learn.microsoft.com/en-us/dotnet/machine-learning/ so would guess you have to give it enough ram to do it's job. You could probably make it swap ram with Disk. But it would make everything painfully slow. – Kiksen Dec 23 '19 at 11:18
  • try to decrease your batch size. what is the current value? – Parth Bhuva Dec 23 '19 at 11:34
  • @Parth Bhuva I really appreciate your input and while I would love to decrease the batch size I don't know how and that's exactly what this question is about. – 230Daniel Dec 24 '19 at 13:02
  • @Kiksen Yeah I'd agree but I think that it's terminating because it's decided that 10% is too much usage or something, I can't get more ram on the VM without paying unfortunately. – 230Daniel Dec 24 '19 at 13:03

1 Answers1

0

click here ,this explains how to create your own input batch with custom Batch Size for a tensorflow model

ARH
  • 51
  • 3
  • 10