Open pmfcdb opened 6 years ago
@pmfcdb just change "v = np.float32([value])" -> "v = np.array(np.float32(value))" in your keras\backend\cntk_backend.py.
def set_learning_phase(value):
global _LEARNING_PHASE
if value not in {0, 1}:
raise ValueError('CNTK Backend: Set learning phase '
'with value %s is not supported, '
'expected 0 or 1.' % value)
#v = np.float32([value])
v = np.array(np.float32(value))
_LEARNING_PHASE.value = v
Hi, thks, it worked, but now I get this error:
Using CNTK backend Selected GPU[0] GeForce GTX 1060 6GB as the process wide default device. Model loaded.
Traceback (most recent call last):
File "C:\Users\pbrito\Documents\PythonApplication3\PythonApplication3\PythonApplication3.py", line 88, in
scaling = K.prod(K.cast(K.shape(x), 'float32'))
File "C:\local\Anaconda3-4.1.1-Windows-x86_64\lib\site-packages\keras\backend\cntk_backend.py", line 615, in prod
axis = _normalize_axis(axis, x)
File "C:\local\Anaconda3-4.1.1-Windows-x86_64\lib\site-packages\keras\backend\cntk_backend.py", line 697, in _normalize_axis
shape = int_shape(x)
File "C:\local\Anaconda3-4.1.1-Windows-x86_64\lib\site-packages\keras\backend\cntk_backend.py", line 314, in int_shape
shape = x.shape
AttributeError: 'list' object has no attribute 'shape' Press any key to continue . . .
Hi,
When I try to run this example "deep_dream.py" from :
https://github.com/fchollet/keras/tree/master/examples
I get this error:
Variable 'Constant('_keras_learning_phase', [], [])' SetValue(): 'source' shape '[1]' differs 'destination' shape '[]'. [CALL STACK]
Thks, PB