为什么Powershell ISE控制台无法正确显示$ args值

时间:2019-02-22 20:02:17

标签: powershell

当我在ISE的断点处停止时,控制台会正确显示所有当前变量,但$ args除外。

考虑以下(非常简单)的脚本:

ValueError: You are passing a target array of shape (1, 1) while using as loss `categorical_crossentropy`. `categorical_crossentropy` expects targets to be binary matrices (1s and 0s) of shape (samples, classes). If your targets are integer classes, you can convert them to the expected format via:
```
from keras.utils import to_categorical
y_binary = to_categorical(y_int)
```

Alternatively, you can use the loss function `sparse_categorical_crossentropy` instead, which does expect integer targets.

我在PS ISE中按以下方式运行脚本,并在最后一行设置断点。

$args.Count
$args[0]
$x = $args.Count
$y = $args[0]
$x
$y
Write-Output "done"

我得到以下(正确)输出:

test.ps1 "abc"

但是,如果我仍在断点上时在ISE控制台中键入以下内容:

1
abc
1
abc

它显示:

$args.Count
$args[0]

即,控制台窗口认为$ args为空。为什么会这样?

如果我在控制台中显示其他脚本变量“ $ x”和“ $ y”,它们将正确显示。

0 个答案:

没有答案