Răsfoiți Sursa

open enable_staic when paddle has enable_static attribute

FlyingQianMM 4 ani în urmă
părinte
comite
97a4aa6868
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  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