/root/miniconda3/envs/py38/lib/python3.8/site-packages/tqdm/auto/__init__.py:2: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0 Please use `tqdm.std.*` instead of `tqdm._tqdm.*` from .._tqdm import TqdmExperimentalWarning /root/miniconda3/envs/py38/lib/python3.8/site-packages/tqdm/autonotebook/__init__.py:8: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0 Please use `tqdm.notebook.*` instead of `tqdm._tqdm_notebook.*` from .._tqdm_notebook import tqdm_notebook as tqdm
时间: 2023-12-20 15:06:01 浏览: 318
这些警告信息是由tqdm库发出的,它正在提醒您在将来版本中某些函数将被移除。建议您使用新版本中的`tqdm.std.*`代替旧版本的`tqdm._tqdm.*`,以及使用`tqdm.notebook.*`代替`tqdm._tqdm_notebook.*`。这些更改可以确保您的代码在将来的版本中仍然正常工作。如果您对这些警告信息有任何疑问或需要进一步的帮助,请告诉我。
相关问题
TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/ConvNeXt/my_dataset.py", line 40, in __getitem__ img = self.transform(a) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 95, in __call__ img = t(img) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 952, in forward i, j, h, w = self.get_params(img, self.scale, self.ratio) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torchvision/transforms/transforms.py", line 913, in get_params width, height = F.get_image_size(img) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torchvision/transforms/functional.py", line 76, in get_image_size return F_pil.get_image_size(img) File "/root/miniconda3/envs/py38/lib/python3.8/site-packages/torchvision/transforms/functional_pil.py", line 27, in get_image_size raise TypeError(f"Unexpected type {type(img)}") TypeError: Unexpected type <class 'numpy.ndarray'>
这个错误是由于在 DataLoader 的 worker 进程中,数据集中的某个样本在进行 transform 时出现了错误。具体来说,是由于 get_image_size 函数期望的 PIL.Image 对象被传入了一个 numpy 数组。你可以检查一下数据集中的这个样本,看看是否正确加载,并且检查一下 transform 中是否使用了正确的数据类型。
Traceback (most recent call last): File "/root/miniconda3/envs/test/bin/yolo", line 8, in <module> sys.exit(entrypoint()) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/cfg/__init__.py", line 394, in entrypoint getattr(model, mode)(**overrides) # default args from model File "/root/miniconda3/envs/test/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, **kwargs) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 252, in predict return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/engine/predictor.py", line 189, in predict_cli for _ in gen: # running CLI inference without accumulating any outputs (do not modify) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 43, in generator_context response = gen.send(None) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/engine/predictor.py", line 215, in stream_inference self.setup_source(source if source is not None else self.args.source) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/engine/predictor.py", line 197, in setup_source self.dataset = load_inference_source(source=source, imgsz=self.imgsz, vid_stride=self.args.vid_stride) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/data/build.py", line 158, in load_inference_source dataset = LoadStreams(source, imgsz=imgsz, vid_stride=vid_stride) File "/root/miniconda3/envs/test/lib/python3.8/site-packages/ultralytics/yolo/data/dataloaders/stream_loaders.py", line 57, in __init__ raise ConnectionError(f'{st}Failed to open {s}') ConnectionError: 1/1: 0... Failed to open 0 Sentry is attempting to send 2 pending events Waiting up to 2 seconds Press Ctrl-C to quit
这个错误信息显示在运行 yolo 时出现了问题。具体来说,它似乎无法打开输入源。错误信息中显示 "Failed to open",并列出了输入源的路径或索引。你可以尝试检查一下输入源是否存在、路径是否正确,或者是否有权限访问该路径。另外,也可以尝试在不同的环境或者不同的计算机上运行看看是否能够解决问题。
阅读全文