【问题标题】:Cannot run Starspace using bash in Google Colab无法在 Google Colab 中使用 bash 运行 Starspace
【发布时间】:2019-04-14 10:20:35
【问题描述】:

我正在尝试在 google colab 中运行此代码。

%%bash
./Starspace/starspace train \
-trainFile "data/prepared_train.tsv" \
-model model/stackoverflow_duplicate \
-trainMode = 3 \
-adagrad true \
-ngrams 1 \
-epoch 5 \
-dim 100 \
-similarity "cosine" \
-minCount 2 \
-verbose true \
-fileFormat labelDoc \
-negSearchLimit 10 \
-lr 0.05 \
-thread 10

但每次我收到此错误Provided argument without a dash!
以及一些关于如何使用的说明。实际上我尝试在 Facebook Github 存储库中使用示例代码,但我得到了同样的错误。

感谢您的建议。

【问题讨论】:

  • Starspace 是库的根文件夹,starspace 文件可以工作。

标签: python bash nlp google-colaboratory


【解决方案1】:

尝试删除文件名、模型名和文件格式中的引号:

######### TRAINING HAPPENING HERE #############
%%bash
./Starspace/starspace train \
-trainFile data/train_prepare.tsv \
-model Starspace_embeddings \
-trainMode 3 \
-adagrad true \
-ngrams 1 \
-epoch 5 \
-dim 100 \
-similarity "cosine" \
-minCount 2 \
-verbose true \
-fileFormat labelDoc \
-negSearchLimit 10 \
-lr 0.05

【讨论】:

  • 感谢您的评论。我在使用“!./starspace train...”时没有指定目录名称,但它显示了我的错误。
【解决方案2】:

我猜这会给你带来麻烦 -trainMode = 3,我认为应该是 -trainMode 3 没有 =

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-17
    • 2019-08-21
    • 2022-12-14
    • 2020-12-01
    • 2021-10-09
    • 1970-01-01
    相关资源
    最近更新 更多