のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

NameError: name 'feature' is not defined

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-38-0bb17743e79e> in <module>()
      9 
     10     # Assign the minibatch data to the input variables and train the model on the minibatch
---> 11     trainer.train_minibatch({feature : features, label : labels})
     12     batchsize, loss, error = print_training_progress(trainer, i, 
     13                                                      training_progress_output_freq, verbose=1)

NameError: name 'feature' is not defined

ValueError: learning_rate type (<class 'float'>) not supported. learning_rate must be a training schedule (output of learning_rate_schedule() function)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-22-e677a538ecd8> in <module>()
      1 # Instantiate the trainer object to drive the model training
      2 learning_rate = 0.02
----> 3 learner = sgd(z.parameters, lr=learning_rate)
      4 trainer = Trainer(z, loss, eval_error, [learner])

~/anaconda3_420/lib/python3.5/site-packages/cntk/internal/swig_helper.py in wrapper(*args, **kwds)
     67     @wraps(f)
     68     def wrapper(*args, **kwds):
---> 69         result = f(*args, **kwds)
     70         map_if_possible(result)
     71         return result

~/anaconda3_420/lib/python3.5/site-packages/cntk/learners/__init__.py in sgd(parameters, lr, l1_regularization_weight, l2_regularization_weight, gaussian_noise_injection_std_dev, gradient_clipping_threshold_per_sample, gradient_clipping_with_truncation, use_mean_gradient)
    443         Networks: Tricks of the Trade: Springer, 2012.
    444     '''
--> 445     _verify_learning_rate_type(lr)
    446     gaussian_noise_injection_std_dev = \
    447         training_parameter_schedule(

~/anaconda3_420/lib/python3.5/site-packages/cntk/learners/__init__.py in _verify_learning_rate_type(learning_rate)
     89                          'learning_rate must be a training schedule '
     90                          '(output of learning_rate_schedule() function)'
---> 91                          % type(learning_rate))
     92 
     93 # an internal method to verify that the mometum schedule

ValueError: learning_rate type (<class 'float'>) not supported. learning_rate must be a training schedule (output of learning_rate_schedule() function)

NameError: name 'cross_entropy_with_softmax' is not defined

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-16-bb8c1973018f> in <module>()
      1 label = input_variable((num_output_classes), np.float32)
----> 2 loss = cross_entropy_with_softmax(z, label)

NameError: name 'cross_entropy_with_softmax' is not defined

cntk.を前につけた。
cntk.cross_entropy_with_softmax(z, label)

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-18-6f5cea00d80d> in <module>()
----> 1 eval_error = classification_error(z, label)

NameError: name 'classification_error' is not defined

cntk.