0

我的问题似乎是CLI 看不到我在 AutoML Tables 产品下的这个项目中创建的模型。对此的任何帮助将不胜感激。

我正在尝试使用 CLI,因为我无法一次通过 Web 界面提交 7000 多个 CSV(Web 界面仅限于一个输入文件。我尝试将 CSV 导入 BigQuery 表,但是导入大约 3M 行后失败。CSV 有大约 7.3B 行。

我很想将它们全部导入 BigQuery,并将 7.3B 的数字降低到我可以合理认为的非零结果,但我也无法将所有 CSV 导入 BigQuery。

无论如何,对于 CLI:

我在这里阅读了 gCloud 的文档:https ://cloud.google.com/ai-platform/prediction/docs/batch-predict但这似乎是指“AI Platform”,而不是 AutoML Tables 产品。当我尝试使用此页面上列出的 CLI 指令时:

gcloud ai-platform jobs submit prediction myJob --model risk_vs_reward_v2 --input-paths "gs://portfolio_ml/test sets/v2 tests/*.csv" --output-path "gs://portfolio_ml/test set results/v2 results" --region us-central1 --data-format text

我得到:

Job [myJob] submitted successfully.
Your job is still active. You may view the status of your job with the command

  $ gcloud ai-platform jobs describe myJob

or continue streaming the logs with the command

  $ gcloud ai-platform jobs stream-logs myJob
ERROR: (gcloud.ai-platform.jobs.submit.prediction) Project [portfolio-ml] not found: Field: prediction_input.model_name Error: The model resource: "risk_vs_reward_v2" was not found. Please create the model resource first by using 'gcloud ai-platform models create risk_vs_reward_v2'.
- '@type': type.googleapis.com/google.rpc.BadRequest
  fieldViolations:
  - description: "The model resource: \"risk_vs_reward_v2\" was not found. Please\
      \ create the model resource first by using 'gcloud ai-platform models create\
      \ risk_vs_reward_v2'."
    field: prediction_input.model_name

当我检查 gCloud 是否可以看到我现在在 AutoML Tables 中拥有的三个模型中的任何一个时:

gcloud ai-platform models list

它回来了 0 模型?

WARNING: Using endpoint [https://ml.googleapis.com/]
Listed 0 items.

我已经验证我选择了正确的项目:

gcloud config set project portfolio-ml
4

1 回答 1

0

我最终使用 AutoIT 循环浏览 Cloud Storage 存储桶中的 CSV,并在本地计算机上的云 CLI 命令中使用它们。我很幸运,我的输入 CSV 已编号,但万一其他人播种类似的东西:

(注意:包含 1M 行的 .csv 每个 CSV 大约需要 20 秒才能从 Cloud Storage 导入 BigQuery。)

#include <MsgBoxConstants.au3>

; press ESC to stop the script in case something goes crazy and you can't click the AutoIT window
HotKeySet("^{ESC}", "Terminate") ; press ESC to stop script
Func Terminate()
   Exit
EndFunc

local $fileStart = 1
local $fileEnd = 1000
local $loadCommand
local $i = $fileStart

local $startTime = TimerInit()
local $avgprocTime = 0
local $remainingTime = 0

while $i <= $fileEnd

   ; see 'bg load' documentation to customize this for your BigQuery table 
   $loadCommand = 'cmd.exe /c bq load --autodetect --noreplace v2.test_criteria "gs://project_ml/test sets/v2 tests/test sets/testset-' & $i & '.csv'
   RunWait($loadCommand,"",@SW_HIDE)

   ; This section is optional, but helpful. If you don't use it, monitor load progress on the BigQuery page or change the @SW_HIDE flag on the RunWait command above so you can see the cmd window and the bg loading status text it shows
   $avgprocTime = TimerDiff($startTime)/($i-$fileStart+1)
   $remainingTime = ($fileEnd-$i)*$avgProcTime
   ConsoleWrite('Loaded file ' & $i & ' of ' & $fileEnd & '. ' & Round((TimerDiff($startTime)/1000)/60,1) & 'm elapsed, ' & Round($remainingTime/1000/60,1) & 'm remaining, ' & Round($avgProcTime/1000,1) & 's per file average.' & @LF)

   ;this is not optional ;)
   $i = $i + 1

WEnd
于 2020-06-24T16:01:45.603 回答