CNTK
CNTK copied to clipboard
Using @cntk.Function.with_signature gives an error
In the tutorial CNTK_050_GuidedTour.ipynb for Python , using the @Function(C.layers.Tensor[input_dim_lr], C.layers.SparseTensor[num_classes_lr]) outputs an Exception (Python 3.6, Windows)
File "C:\Users\ama\Anaconda3\Lib\site-packages\cntk\ops\functions.py", line 124, in _to_Function f_name = f.name # (only used for debugging and error messages) File "C:\Users\ama\Anaconda3\Lib\site-packages\cntk\variables.py", line 31, in getattr raise AttributeError("record has no attribute '{}'".format(key)) builtins.AttributeError: record has no attribute 'name'
I tried the following which works
@C.Function
def criterion(x: C.layers.Tensor[5], y: C.layers.Tensor[10]):
z = model(x)
loss = C.cross_entropy_with_softmax(z,y)
metrics = C.classification_error(z,y)
return loss, metrics
but criterion does not have train function as indicated in the tutorial