1

Is there a way that I can use mx.recordio.MXRecordIO to read from a bytes object rather than a file object?

For example I'm currently doing:

import mxnet as mx

results_file = 'results.rec'
with open(results_file, 'wb') as f:
    f.write(results)

recordio = mx.recordio.MXRecordIO(results_file, 'r')
temp = recordio.read()

But if possible I'd rather not have to write to file as an intermediate step. I've tried using BytesIO, but can't seem to get it to work.

Austin
  • 6,921
  • 12
  • 73
  • 138

1 Answers1

1

Currently they is no way of achieving this sorry. This is non-trivial because the RecordIO reading/parsing is done in C++ and you can't simply forward the stream to the C++ API.

Thomas
  • 676
  • 3
  • 18