怎么和项目的作者交流?
收藏
快速回复
AI Studio平台使用 问答其他 593 7
怎么和项目的作者交流?
收藏
快速回复
AI Studio平台使用 问答其他 593 7

怎么和项目的作者交流?

有时候报错,不能运行下期

例如项目“带你玩转12生肖分类 ”https://aistudio.baidu.com/aistudio/projectdetail/1470189?channelType=0&channel=0

from config import get

首先是报错“cannot import name 'get' from 'config'”,在自己 !pip install config 后还是报错“cannot import name 'get' from 'config'”

0
收藏
回复
全部评论(7)
时间顺序
AIStudio810259
#2 回复于2021-02

这个啊,有个文件

config.py

__all__ = ['CONFIG', 'get']

CONFIG = {
    'model_save_dir': "./output/zodiac",
    'num_classes': 12,
    'total_images': 7096,
    'epochs': 20,
    'batch_size': 32,
    'image_shape': [3, 224, 224],
    'LEARNING_RATE': {
        'params': {
            'lr': 0.00375             
        }
    },
    'OPTIMIZER': {
        'params': {
            'momentum': 0.9
        },
        'regularizer': {
            'function': 'L2',
            'factor': 0.000001
        }
    },
    'LABEL_MAP': [
        "ratt",
        "ox",
        "tiger",
        "rabbit",
        "dragon",
        "snake",
        "horse",
        "goat",
        "monkey",
        "rooster",
        "dog",
        "pig",
    ]
}

def get(full_path):
    for id, name in enumerate(full_path.split('.')):
        if id == 0:
            config = CONFIG
        
        config = config[name]
    
    return config
0
回复
lg21c8
#3 回复于2021-02
这个啊,有个文件 config.py [代码]

你怎么知道的?我还以为是安装config包

0
回复
AIStudio810259
#4 回复于2021-02
lg21c8 #3
你怎么知道的?我还以为是安装config包

我听课了啊。

0
回复
lg21c8
#5 回复于2021-02
我听课了啊。

这些文件不是应该附带在项目中的?不然不能自然运行下去

0
回复
AIStudio810258
#6 回复于2021-02

在项目的评论区留言,作者看到就会恢复了

0
回复
AIStudio810260
#7 回复于2021-02

像config这种命名,一般不太可能是pip的包,所以大概率就是一个config.py文件没加载进去

0
回复
AIStudio810260
#8 回复于2021-02
像config这种命名,一般不太可能是pip的包,所以大概率就是一个config.py文件没加载进去

另一方面,一般自定义的.py文件也不会和pip包重名,不然都不知道应该引用哪一个

0
回复
在@后输入用户全名并按空格结束,可艾特全站任一用户