|
@@ -1,14 +1,28 @@
|
|
|
|
|
|
|
|
|
-from PointerNet.config import rootdir
|
|
|
-print(rootdir)
|
|
|
+# from PointerNet.config import rootdir
|
|
|
+# print(rootdir)
|
|
|
|
|
|
|
|
|
-from PointerNet.main import NerPipeline
|
|
|
-from PointerNet.model import UIEModel
|
|
|
-from PointerNet import config
|
|
|
+# from PointerNet.main import NerPipeline
|
|
|
+# from PointerNet.model import UIEModel
|
|
|
+# from PointerNet import config
|
|
|
|
|
|
-nerArgs = config.NerArgs()
|
|
|
-print(dir(nerArgs))
|
|
|
+# nerArgs = config.NerArgs()
|
|
|
+# print(dir(nerArgs))
|
|
|
# model = UIEModel(nerArgs)
|
|
|
# ner_pipeline = NerPipeline(model, nerArgs)
|
|
|
+
|
|
|
+
|
|
|
+from memory_profiler import profile
|
|
|
+from PointerNet import config
|
|
|
+from PointerNet.predictor import Predictor
|
|
|
+from PointerNet.main import NerPipeline
|
|
|
+from PointerNet.model import UIEModel
|
|
|
+import gc
|
|
|
+
|
|
|
+@profile(precision=2) # 会显示执行到每一行时所占的总内存
|
|
|
+def run_code():
|
|
|
+ nerArgs = config.NerArgs()
|
|
|
+ pred = Predictor(nerArgs) # 725M
|
|
|
+run_code()
|