Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix import #635

Merged
merged 4 commits into from
Jun 26, 2024
Merged

fix import #635

merged 4 commits into from
Jun 26, 2024

Conversation

SAKURA-CAT
Copy link
Contributor

Description

修复了空环境下的import错误

@SAKURA-CAT SAKURA-CAT added the 🐛 bug Something isn't working label Jun 24, 2024
@SAKURA-CAT SAKURA-CAT requested a review from Zeyi-Lin June 24, 2024 14:30
@SAKURA-CAT SAKURA-CAT self-assigned this Jun 24, 2024
@Zeyi-Lin
Copy link
Member

Zeyi-Lin commented Jun 26, 2024

还是不行:

(test_env2) PS D:\Project\SwanLab> swanlab -v
Traceback (most recent call last):
  File "D:\anaconda\envs\test_env2\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\anaconda\envs\test_env2\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\anaconda\envs\test_env2\Scripts\swanlab.exe\__main__.py", line 4, in <module>
  File "D:\anaconda\envs\test_env2\lib\site-packages\swanlab\__init__.py", line 2, in <module>
    from .data import (
  File "D:\anaconda\envs\test_env2\lib\site-packages\swanlab\data\__init__.py", line 10, in <module>
    from .modules import (
  File "D:\anaconda\envs\test_env2\lib\site-packages\swanlab\data\modules\__init__.py", line 1, in <module>
    from .audio import Audio
  File "D:\anaconda\envs\test_env2\lib\site-packages\swanlab\data\modules\audio\__init__.py", line 22, in <module>
    class Audio(MediaType):
  File "D:\anaconda\envs\test_env2\lib\site-packages\swanlab\data\modules\audio\__init__.py", line 27, in Audio
    data_or_path: Union[str, np.ndarray],
AttributeError: 'NoneType' object has no attribute 'ndarray'

@SAKURA-CAT
Copy link
Contributor Author

根据这段代码和报错信息来看,你没有完成更新 @Zeyi-Lin

image

@SAKURA-CAT
Copy link
Contributor Author

看起来image部分需要使用按需导入的方式,这将在新pr完成

@SAKURA-CAT SAKURA-CAT merged commit bca8ef3 into main Jun 26, 2024
@SAKURA-CAT SAKURA-CAT deleted the bugfix/import-error branch June 26, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants