Skip to content

numpy版本问题 #3

@GoldenJin24

Description

@GoldenJin24

2025年4月8日

conda创建环境,按顺序python=3.9,torch,gym后发现numpy版本不对

报错信息:    407     import numpy.char as char
    408     return char.chararray
--> 410 raise AttributeError("module {!r} has no attribute "
    411                      "{!r}".format(__name__, attr))

AttributeError: module 'numpy' has no attribute 'bool8'   
  • 问了问gpt后发现需要把2.x的numpy降级到1.23.5即可,跑了跑REINFORCE的代码没问题了。
pip uninstall numpy
pip install numpy==1.23.5 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions