pickling python objects to google cloud storage

前端 未结 3 1257
南方客
南方客 2021-01-20 08:22

I\'ve been pickling the objects to filesystem and reading them back when needed to work with those objects. Currently I\'ve this code for that purpose.

def p         


        
3条回答
  •  萌比男神i
    2021-01-20 09:06

    One other option (I tested it with Tensorflow 2.2.0) which also works with Python 3:

    from tensorflow.python.lib.io import file_io
    
    with file_io.FileIO('gs://....', mode='rb') as f:
        pickle.load(f)
    

    This very usefull is you already use Tensorflow for example.

提交回复
热议问题