Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error: invalid syntax #2

Open
sungminha opened this issue Mar 23, 2021 · 1 comment
Open

Syntax Error: invalid syntax #2

sungminha opened this issue Mar 23, 2021 · 1 comment

Comments

@sungminha
Copy link

I am using the following:

CentOS 6.10
Cuda 9.0
Tensorflow 1.10.0
Keras 2.2.0
Python 3.6

I am getting the following error:

Using TensorFlow backend.
/scratch/hasm/conda/envs/py3_6_dunet/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/scratch/hasm/conda/envs/py3_6_dunet/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/scratch/hasm/conda/envs/py3_6_dunet/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/scratch/hasm/conda/envs/py3_6_dunet/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/scratch/hasm/conda/envs/py3_6_dunet/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/scratch/hasm/conda/envs/py3_6_dunet/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "Stroke_segment.py", line 4, in
from Statistics import *
File "/scratch/hasm/Data/Lesion/Unet_Test/D-UNet/Statistics.py", line 106
-K.mean(1-alpha)*K.pow(pt_0,gamma)*K.log(1. -pt_0),axis=-1)
^
SyntaxError: invalid syntax

Do you have any suggestion how to debug this?

@jcfszxc
Copy link

jcfszxc commented Apr 13, 2021

line 106
true is : -K.mean((1-alpha)*K.pow(pt_0,gamma)*K.log(1. -pt_0),axis=-1)
wrong is : -K.mean(1-alpha)*K.pow(pt_0,gamma)*K.log(1. -pt_0),axis=-1)

code lost a '('

you need to add it.

but I still have some problem at line 102 "y_pred = K.clip(y_pred, K.epsilon())"

I guess this line may not be necessary, so I commented it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants