一、问题描述

Traceback (most recent call last):
  File “D:Usersanaconda3envspytorchlibsitepackagesIPythoncoreinteractiveshell.py“, line 2862, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File “<ipythoninput-3-2982c1b094ea>”, line 1, in <module>
    from torch.utils.tensorboard import SummaryWriter
  File “E:Program FilesIDEPyCharmPyCharm Community Edition 2023.2.4pluginspythoncehelperspydev_pydev_bundlepydev_import_hook.py“, line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File “D:Usersanaconda3envspytorchlibsitepackagestorchutilstensorboard__init__.py”, line 1, in <module&gt;
    import tensorboard
  File “E:Program FilesIDEPyCharmPyCharm Community Edition 2023.2.4pluginspythoncehelperspydev_pydev_bundlepydev_import_hook.py”, line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named ‘tensorboard’

二、解决方案

需要进入虚拟环境使用命令conda install tensorboard安装tensorboard,不要使用pip命令,进入虚拟环境使用命令pip install tensorboard安装tensorboard会报错,经过尝试发现就不报错了。

原文地址:https://blog.csdn.net/qq_34425255/article/details/134339907

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_22348.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注