ckiptagger icon indicating copy to clipboard operation
ckiptagger copied to clipboard

請問這是基於哪一個版本的 TensorFlow 設計 ?

Open allen108108 opened this issue 5 years ago • 3 comments

我在 tf 1.12 下安裝之後 import 會跳錯 module 'tensorflow._api.v1.compat' has no attribute 'v1'

在 tf2.0 下可以import,但不能載入模型,載入也會跳錯 module 'tensorflow' has no attribute 'variable_scope'

請問我可以怎麼解決它 ?

allen108108 avatar Sep 08 '19 18:09 allen108108

目前可執行在

  • tensorflow==1.15.0
  • tensorflow==1.14.0
  • tensorflow==1.13.2
  • tensorflow==1.13.1

jacobvsdanniel avatar Sep 09 '19 03:09 jacobvsdanniel

一個比較簡單的方式是切換兩個虛擬環境

我也是用tf2.0, 所以我另外建立一個ckiptagger 環境專門處理斷詞 需要用ckiptagger做得事情我都放在ckipjob.py裡面

之後我會在tf2.0環境的code裡面執行下面這一段

os.system('. /to/your/venv/ckiptagger/bin/activate && python ckipjob.py')

這樣就只有執行ckipjob.py時會用 tf 1.14

這做法有點髒 目前我考慮另外建server來處理這件事

hchungdelta avatar Sep 09 '19 04:09 hchungdelta

Merge #27。目前版本和TensorFlow 1.15及2.3皆相容。

jacobvsdanniel avatar Sep 09 '20 22:09 jacobvsdanniel