dataloader_test = get_dataloader(opts)
path_intermediate_dir = os.path.join(opts.path_save_dir, os.path.basename(opts.path_model_dir))
if not os.path.exists(path_intermediate_dir):
os.makedirs(path_intermediate_dir)
with open(os.path.join(path_intermediate_dir, "predict_options.json"), "w") as fo:
json.dump(vars(opts), fo, indent=4, sort_keys=True)
for i, (signal, target) in enumerate(dataloader_test):
After Change
model = fnet.load_model_from_dir(opts.path_model_dir, opts.gpu_ids)
print(model)
dataloader = get_dataloader(opts)
entries = []
for i, (signal, target) in enumerate(dataloader):
prediction = model.predict(signal)
path_tiff_dir = os.path.join(opts.path_save_dir, "{:02d}".format(i))
if not os.path.exists(path_tiff_dir):