Skip to content
Snippets Groups Projects
Commit fa3013b4 authored by Yoann Schneider's avatar Yoann Schneider :tennis: Committed by Mélodie Boillet
Browse files

Remove deepcopy when I can

parent 71d1406c
No related branches found
No related tags found
1 merge request!174Remove deepcopy when I can
# -*- coding: utf-8 -*-
import copy
import os
import pickle
......@@ -62,7 +61,7 @@ class OCRDataset(GenericDataset):
self.collate_function = OCRCollateFunction
def __getitem__(self, idx):
sample = copy.deepcopy(self.samples[idx])
sample = dict(**self.samples[idx])
if not self.load_in_memory:
sample["img"] = self.get_sample_img(idx)
......
# -*- coding: utf-8 -*-
import copy
import json
import os
import random
from copy import deepcopy
from time import time
import numpy as np
......@@ -481,8 +481,7 @@ class GenericTrainingManager:
path = os.path.join(self.paths["results"], "params")
if os.path.isfile(path):
return
params = copy.deepcopy(self.params)
params = class_to_str_dict(params)
params = class_to_str_dict(my_dict=deepcopy(self.params))
total_params = 0
for model_name in self.models.keys():
current_params = compute_nb_params(self.models[model_name])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment