python cnn kd99 卷积神经网络问题

各位大佬,本人在使用卷积神经网络算法训练kdd99数据集时遇到了某些问题,想请教一个,希望大家能帮忙看看,谢谢

AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'

下面是代码和出现和问题:

if __name__ == '__main__':
    start_time=time.clock()
    
    with tf.Session() as sess:
        ckpt = tf.train.get_checkpoint_state('ckpt-5/')  # 通过检查点文件锁定最新的模型
        saver = tf.train.import_meta_graph(ckpt.model_checkpoint_path + '.meta')  # 载入图结构,保存在.meta文件中
        if ckpt and ckpt.model_checkpoint_path:
            global_step = ckpt.model_checkpoint_path.split('/')[-1].split('-')[-1]
            saver.restore(sess, ckpt.model_checkpoint_path)
            print('Loading success')
        else:
            print('No checkpoint')

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值