diff --git a/app/controller/AlgorithmController.py b/app/controller/AlgorithmController.py index 75d7c38..121afbc 100644 --- a/app/controller/AlgorithmController.py +++ b/app/controller/AlgorithmController.py @@ -312,7 +312,6 @@ def Export_model_RODY(params_str): return exp_outputPath - @obtain_train_param() def returnTrainParams(): # nvmlInit() diff --git a/app/yolov5/train_server.py b/app/yolov5/train_server.py index 07ff125..c122f9d 100644 --- a/app/yolov5/train_server.py +++ b/app/yolov5/train_server.py @@ -72,7 +72,7 @@ def yaml_rewrite(file='data.yaml',data_list=[]): with open(file, errors='ignore') as f: coco_dict = yaml.safe_load(f) #读取img_label_type.json - with open(data_list[3], 'r') as f: + with open(data_list[3], 'r',encoding='UTF-8') as f: class_dict = json.load(f) f.close() classes = class_dict["classes"] diff --git a/app/yolov5/utils/dataloaders.py b/app/yolov5/utils/dataloaders.py index 90de966..9b8a9b8 100644 --- a/app/yolov5/utils/dataloaders.py +++ b/app/yolov5/utils/dataloaders.py @@ -430,9 +430,12 @@ class LoadImagesAndLabels(Dataset): self.label_files = img2label_paths(self.im_files) # labels cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') try: - cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict - assert cache['version'] == self.cache_version # matches current version - assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical has + # cache, exists = np.load(cache_path, allow_pickle=True).item(), True # load dict + # assert cache['version'] == self.cache_version # matches current version + # assert cache['hash'] == get_hash(self.label_files + self.im_files) # identical has + if os.path.exists(cache_path): + os.remove(cache_path) + cache, exists = self.cache_labels(cache_path, prefix), False # run cache ops except Exception: cache, exists = self.cache_labels(cache_path, prefix), False # run cache ops