python module has no attribute_求助AttributeError: module ' ' has no attribute ''

引用回帖:

天天进步啊 at 2020-04-15 20:41:22

一看就知道是python代码,先把你代码贴出来,再讲你的报错...

您好,这个代码是Yan Wu, Mihaela Rosca, Timothy Lillicrap Deep Compressed Sensing. ICML 2019的开源代码(This is the example code for the following ICML 2019 paper. If you use the code here please cite this paper),网址https://github.com/deepmind/deepmind-research/tree/master/cs_gan

下面是报错,运行后报错的main_cs.py文件以及utils.py文件代码

File "D:\deep compressed sensing\main_cs.py", line 76, in main

images = utils.get_train_dataset(data_processor, FLAGS.dataset,

AttributeError: module 'cs_gan.utils' has no attribute 'get_train_dataset'

#main_cs.py

"""Training script."""

from __future__ import absolute_import

from __future__ import division

from __future__ import print_function

import os

from absl import app

from absl import flags

from absl import logging

import tensorflow.compat.v1 as tf

import tensorflow_probability as tfp

from cs_gan import cs

from cs_gan import file_utils

from cs_gan import utils

tfd = tfp.distributions

flags.DEFINE_string(

'mode', 'recons', 'Model mode.')

flags.DEFINE_integer(

'num_training_iterations', 10000000,

'Number of training iterations.')

flags.DEFINE_integer(

'batch_size', 64, 'Training batch size.')

flags.DEFINE_integer(

'num_measurements', 25, 'The number of measurements')

flags.DEFINE_integer(

'num_latents', 100, 'The number of latents')

flags.DEFINE_integer(

'num_z_iters', 3, 'The number of latent optimisation steps.')

flags.DEFINE_float(

'z_step_size', 0.01, 'Step size for latent optimisation.')

flags.DEFINE_string(

'z_project_method', 'norm', 'The method to project z.')

flags.DEFINE_integer(

'summary_every_step', 1000,

'The interval at which to log debug ops.')

flags.DEFINE_integer(

'export_every', 10,

'The interval at which to export samples.')

flags.DEFINE_string(

'dataset', 'mnist', 'The dataset used for learning (cifar|mnist.')

flags.DEFINE_float('learning_rate', 1e-4, 'Learning rate.')

flags.DEFINE_string(

'output_dir', '/tmp/cs_gan/cs', 'Location where to save output files.')

FLAGS = flags.FLAGS

# Log info level (

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值