From cfd987bc8613d300c6a543f46d533547c64fb289 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Feb 2024 07:39:10 +0000 Subject: [PATCH 1/2] Update tensorflow requirement from <=2.13.1 to <=2.15.0.post1 Updates the requirements on [tensorflow](https://github.com/tensorflow/tensorflow) to permit the latest version. - [Release notes](https://github.com/tensorflow/tensorflow/releases) - [Changelog](https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md) - [Commits](https://github.com/tensorflow/tensorflow/commits) --- updated-dependencies: - dependency-name: tensorflow dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 26765dfadad..d47b3980ab8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,7 +98,7 @@ export = [ "onnx>=1.12.0", # ONNX export "coremltools>=7.0; platform_system != 'Windows'", # CoreML only supported on macOS and Linux "openvino-dev>=2023.0", # OpenVINO export - "tensorflow<=2.13.1", # TF bug https://github.com/ultralytics/ultralytics/issues/5161 + "tensorflow<=2.15.0.post1", # TF bug https://github.com/ultralytics/ultralytics/issues/5161 "tensorflowjs>=3.9.0", # TF.js export, automatically installs tensorflow ] # tensorflow>=2.4.1,<=2.13.1 # TF exports (-cpu, -aarch64, -macos) From cc00d99607a2d9401cd05c8d336e945461d94646 Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Wed, 21 Feb 2024 07:39:42 +0000 Subject: [PATCH 2/2] Auto-format by https://ultralytics.com/actions --- segment/train.py | 3 ++- train.py | 3 ++- utils/dataloaders.py | 17 +++++++++++++---- val.py | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/segment/train.py b/segment/train.py index d835d92234b..8c1aaaf7a44 100644 --- a/segment/train.py +++ b/segment/train.py @@ -399,7 +399,8 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio mem = f"{torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0:.3g}G" # (GB) pbar.set_description( ("%11s" * 2 + "%11.4g" * 6) - % (f"{epoch}/{epochs - 1}", mem, *mloss, targets.shape[0], imgs.shape[-1]), refresh=False + % (f"{epoch}/{epochs - 1}", mem, *mloss, targets.shape[0], imgs.shape[-1]), + refresh=False, ) # callbacks.run('on_train_batch_end', model, ni, imgs, targets, paths) # if callbacks.stop_training: diff --git a/train.py b/train.py index 6bd94eef51f..28d880c7676 100644 --- a/train.py +++ b/train.py @@ -400,7 +400,8 @@ def train(hyp, opt, device, callbacks): # hyp is path/to/hyp.yaml or hyp dictio mem = f"{torch.cuda.memory_reserved() / 1E9 if torch.cuda.is_available() else 0:.3g}G" # (GB) pbar.set_description( ("%11s" * 2 + "%11.4g" * 5) - % (f"{epoch}/{epochs - 1}", mem, *mloss, targets.shape[0], imgs.shape[-1]), refresh=False + % (f"{epoch}/{epochs - 1}", mem, *mloss, targets.shape[0], imgs.shape[-1]), + refresh=False, ) callbacks.run("on_train_batch_end", model, ni, imgs, targets, paths, list(mloss)) if callbacks.stop_training: diff --git a/utils/dataloaders.py b/utils/dataloaders.py index f033429c27a..af78eb17323 100644 --- a/utils/dataloaders.py +++ b/utils/dataloaders.py @@ -562,7 +562,9 @@ def __init__( nf, nm, ne, nc, n = cache.pop("results") # found, missing, empty, corrupt, total if exists and LOCAL_RANK in {-1, 0}: d = f"Scanning {cache_path}... {nf} images, {nm + ne} backgrounds, {nc} corrupt" - tqdm(None, mininterval=30.0, desc=prefix + d, total=n, initial=n, bar_format=TQDM_BAR_FORMAT) # display cache results + tqdm( + None, mininterval=30.0, desc=prefix + d, total=n, initial=n, bar_format=TQDM_BAR_FORMAT + ) # display cache results if cache["msgs"]: LOGGER.info("\n".join(cache["msgs"])) # display warnings assert nf > 0 or not augment, f"{prefix}No labels found in {cache_path}, can not start training. {HELP_URL}" @@ -646,7 +648,9 @@ def __init__( self.im_hw0, self.im_hw = [None] * n, [None] * n fcn = self.cache_images_to_disk if cache_images == "disk" else self.load_image results = ThreadPool(NUM_THREADS).imap(lambda i: (i, fcn(i)), self.indices) - pbar = tqdm(results, total=len(self.indices), mininterval=30.0, bar_format=TQDM_BAR_FORMAT, disable=LOCAL_RANK > 0) + pbar = tqdm( + results, total=len(self.indices), mininterval=30.0, bar_format=TQDM_BAR_FORMAT, disable=LOCAL_RANK > 0 + ) for i, x in pbar: if cache_images == "disk": b += self.npy_files[i].stat().st_size @@ -684,7 +688,7 @@ def cache_labels(self, path=Path("./labels.cache"), prefix=""): pbar = tqdm( pool.imap(verify_image_label, zip(self.im_files, self.label_files, repeat(prefix))), desc=desc, - mininterval=30.0, + mininterval=30.0, total=len(self.im_files), bar_format=TQDM_BAR_FORMAT, ) @@ -1242,7 +1246,12 @@ def process_images(self): continue dataset = LoadImagesAndLabels(self.data[split]) # load dataset desc = f"{split} images" - for _ in tqdm(ThreadPool(NUM_THREADS).imap(self._hub_ops, dataset.im_files), total=dataset.n, mininterval=30.0, desc=desc): + for _ in tqdm( + ThreadPool(NUM_THREADS).imap(self._hub_ops, dataset.im_files), + total=dataset.n, + mininterval=30.0, + desc=desc, + ): pass print(f"Done. All images saved to {self.im_dir}") return self.im_dir diff --git a/val.py b/val.py index 73b2c3e99d8..76749d9904a 100644 --- a/val.py +++ b/val.py @@ -215,7 +215,7 @@ def run( dt = Profile(device=device), Profile(device=device), Profile(device=device) # profiling times loss = torch.zeros(3, device=device) jdict, stats, ap, ap_class = [], [], [], [] - callbacks.run('on_val_start') + callbacks.run("on_val_start") pbar = tqdm(dataloader, desc=s, mininterval=30.0, bar_format=TQDM_BAR_FORMAT) # progress bar for batch_i, (im, targets, paths, shapes) in enumerate(pbar): callbacks.run("on_val_batch_start")