ValueError: You selected an invalid strategy name: `strategy=None`. It must be either a string or an instance of `pytorch_lightning.strategies.Strategy`. Example choices: auto, ddp, ddp_spawn, deepspeed, ... Find a complete list of options in our documentation at https://lightning.ai
时间: 2023-06-16 15:05:42 浏览: 132
这个错误提示意味着你在使用 PyTorch Lightning 框架时选择了一个无效的分布式训练策略名称。您需要选择一个有效的策略名称或将其设置为 `None` 以使用默认的策略。有效的策略名称包括 `auto`、`ddp`、`ddp_spawn`、`deepspeed` 等。您可以在 PyTorch Lightning 文档中找到完整的选项列表,以了解每种策略的用途和限制。
相关问题
ValueError: You selected an invalid strategy name: `strategy=None`. It must be either a string or an instance of `pytorch_lightning.strategies.Strategy`. Example choices: auto, ddp, ddp_spawn, deepspeed,
这个错误通常是由于使用了不支持的策略名称或未指定策略而导致的。在 PyTorch Lightning 中,`strategy` 参数用于指定训练时使用的分布式策略。它可以是以下值之一:
- `'ddp'`: 分布式数据并行
- `'ddp_cpu'`: 仅在 CPU 上使用分布式数据并行
- `'ddp2'`: 用于 PyTorch 1.6+ 的分布式数据并行
- `'ddp_spawn'`: 使用 `torch.multiprocessing.spawn` 的分布式数据并行
- `'ddp_sharded'`: 分布式数据并行与模型分片
- `'deepspeed'`: 使用 DeepSpeed 分布式训练
- `'horovod'`: 使用 Horovod 分布式训练
- `'tpu'`: 使用 TPUStrategy 的 TPU 分布式训练
如果您没有指定策略,则默认情况下将使用 `'dp'`(数据并行)策略。要解决此问题,请确保您指定了一个有效的策略名称或正确地设置了分布式环境。例如,如果您想在单个节点上使用分布式数据并行,则可以将 `strategy` 参数设置为 `'ddp_spawn'`。
browser = webdriver.Chrome()报错ValueError: Timeout value connect was , but it must be an int, float or None.
这个错误是因为 `webdriver.Chrome()` 方法的 `timeout` 参数需要传入一个整数、浮点数或 `None`,但是你传入了一个空值或非数字类型的值。你可以尝试修改代码为:
```
from selenium import webdriver
browser = webdriver.Chrome(timeout=10)
```
其中 `timeout` 参数的值可以根据你的需要进行调整。如果你不需要设置超时时间,可以将其设置为 `None`。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)