Explorar o código

open enable_staic when paddle has enable_static attribute

FlyingQianMM %!s(int64=4) %!d(string=hai) anos
pai
achega
97a4aa6868
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      paddlex/__init__.py

+ 1 - 0
paddlex/__init__.py

@@ -36,6 +36,7 @@ elif version[0] == '2':
     print(
         "[WARNING] You are using paddlepaddle(v{}) which may not compatible with paddlex(v{}), paddlepaddle==1.8.4 is strongly recommended.".
         format(paddle.__version__, __version__))
+if hasattr(paddle, 'enable_static'):
     paddle.enable_static()
 
 from .utils.utils import get_environ_info