のねのBlog

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

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)