MLBazaar/MLPrimitives

Save `keras` primitives in Windows environment

sarahmish opened this issue · 0 comments

  • MLPrimitives version: 0.2.5
  • Python version: 3.7
  • Operating System: windows 10

Description

Saving any keras based model using the adapter in windows machine, we get the following error

OSError: Unable to create file (unable to open file: name = 'C:\Users\Sarah\AppData\Local\Temp\tmp2ll0lzdn.hdf5', errno = 13, error message = 'Permission denied', flags = 13, o_flags = 302)

In windows, when we create temporary files, we need to explicitly set the permissions of the file in order to write to it. A quick fix to this problem is to set delete=False in the state setting and getting mode.

with tempfile.NamedTemporaryFile(suffix='.hdf5', delete=True) as fd: