2401_84654285 2025-03-05 15:18 采纳率: 0%
浏览 11

yolov5-5.0运行prune.py剪枝是报错

prune.py::test ERROR [ 50%]
test setup failed
file D:\yolov5prune-5.0\prune.py, line 29
def test(data,
E fixture 'data' not found

  available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

D:\yolov5prune-5.0\prune.py:29

prune.py::test_prune ERROR [100%]
test setup failed
file D:\yolov5prune-5.0\prune.py, line 298
def test_prune(data,
E fixture 'data' not found

  available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

D:\yolov5prune-5.0\prune.py:298

  • 写回答

4条回答 默认 最新

  • 阿里嘎多学长 2025-03-05 15:18
    关注

    阿里嘎多学长整理AIGC生成,因移动端显示问题导致当前答案未能完全显示,请使用PC端查看更加详细的解答过程

    Yolov5-5.0运行prune.py剪枝报错

    你遇到了Yolov5-5.0中的prune.py文件运行报错的问题。prune.py文件用于模型剪枝,减少模型的计算复杂度和参数数量。

    根据你的错误信息,错误发生在test setup failed阶段,可能是由于prune.py文件中的测试代码出错。

    可以尝试以下解决方案:

    1. 检查prune.py文件中的代码是否正确,是否有语法错误或逻辑错误。
    2. 检查Yolov5-5.0的安装是否正确,是否缺少某些依赖项。
    3. 尝试使用其他的prune工具,例如torch.nn.utils.prune,来实现模型剪枝。

    如果你需要更多帮助,可以提供prune.py文件的代码和Yolov5-5.0的版本信息。

    评论

报告相同问题?

问题事件

  • 创建了问题 3月5日