安装一个github东西(C-3-Framework)出的问题

[补充]我后期用ubuntu系统运行,就没有出现下面这些问题,开始用的torch1.7,python3.6跑几个实验还会出现中断的问题,我换成torch1.0,python3.6就没有这些问题了!(路径还是用全路径比较好,同时将ProcessedData放在C3-Framework外面,因为他每次实验都会将C3-Framework文件夹中的东西都复制进去。)

github地址为:https://github.com/gjy3035/C-3-Framework

1.python.exe无法找到入口

出现这个错误,找到这个C.pyd文件删除就好了

2.raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.forma

解决方案:

是把含有多线程操作的部分放在 if __name__ == '__main__' 的范围内,在我这里即

if __name__ == '__main__':
    for epoch in range(3):
        for step, (batch_x, batch_y) in enumerate(loader): 
            # 假设这里就是你训练的地方...

每次出错都会报很多错误,我们找到相应的其中一个错误,把这个错误解决这个问题就解决了!

3.AttributeError: 'EasyDict' object has no attribute 'iteritems 

解决方案:

you’re using Python 3.
You just need to replace „a.iteritems()“ with „a.items()“ (Check out this link: python - Error: " 'dict' object has no attribute 'iteritems' " - Stack Overflow).
You might have to change 1-2 other small things in the code if you’re using Python 3 (nothing too complicated though, but I guess you’ll get another 1-2 or more exceptions that you’d need to fix before it works with Python 3).
Otherwise it might be easier to use Python 2 if you just want to run the model.

训练是config.py用的他的配置文件的话会出现 AttributeError: 'EasyDict' object has no attribute 'RESUME'这个错误

这是因为config.py没有RESUME这个参数(这个参数管着是否接着上一次的训练结果继续训练)

4.TensorFlow报AttributeError: module tensorflow has no attribute io

将 with tf.io.gfile.GFile(path, 'r') as fid:

改为with tf.gfile.GFile(path, 'r') as fid:

但是又出现了新的错误:

AttributeError: module 'tensorflow' has no attribute 'gfile'

解决方法:直接pip install io(升级tensorflow到2.x版本)

5.TabError: Inconsistent use of tabs and spaces in indentation

这个错误的解决通过将代码复制到sublime text3中,定位到出问题的行,然后将没有问题的行的代码的空格复制到有问题哪里,就解决了!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值