mirror of
https://github.com/newnius/YAO-Dockerfiles.git
synced 2025-12-13 09:36:43 +00:00
update
This commit is contained in:
20
tensorflow/1.14-gpu/save.py
Normal file
20
tensorflow/1.14-gpu/save.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from hdfs import *
|
||||
import os
|
||||
import time
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.environ["TZ"] = 'Asia/Shanghai'
|
||||
if hasattr(time, 'tzset'):
|
||||
time.tzset()
|
||||
try:
|
||||
hdfs_address = os.environ['hdfs_address']
|
||||
hdfs_dir = os.environ['hdfs_dir']
|
||||
output_dir = os.environ['output_dir']
|
||||
|
||||
client = Client(hdfs_address)
|
||||
client.upload(hdfs_dir, output_dir)
|
||||
|
||||
print('Save ' + output_dir + 'to' + hdfs_address + ' ' + hdfs_dir)
|
||||
except Exception as e:
|
||||
print('Unable to persist data to HDFS,', str(e))
|
||||
Reference in New Issue
Block a user