forked from CRBS/cdeep3m2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy_model.py
More file actions
27 lines (24 loc) · 756 Bytes
/
copy_model.py
File metadata and controls
27 lines (24 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Usage copy_model( base_dir, the_model, dest_dir )
##
# Starting from base_dir directory this function
# copies *txt files from model/inception_residual_train_prediction_<the_model>
# to directory specified by dest_dir argument. If copy fails
# error() is invoked describing the issue
##
import glob
import shutil
import os
def copy_model(base_dir, the_model, dest_dir):
src_files = os.path.join(
base_dir,
'model',
'inception_residual_train_prediction_' +
the_model,
'*txt')
# print (src_files)
for filename in glob.glob(src_files):
try:
shutil.copy(filename, dest_dir)
except Exception as e:
print('Error copying model ', the_model, '\n', str(e))
return