我正在关注本教程:https : //cloud.google.com/kubernetes-engine/docs/tutorials/hello-app for Google Cloud Platform。我正在使用 Google Cloud Shell 命令行。当我到达以下步骤时:要构建此应用程序的容器映像并将其标记为上传,请运行以下命令:
docker build -t gcr.io/${PROJECT_ID}/hello-app:v1 .
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
invalid argument "gcr.io//hello-app:v1" for "-t, --tag" flag: invalid reference format
Run Code Online (Sandbox Code Playgroud)
请记住,我已经有 3 个实例集群(从 Kubernetes Engine 创建)和一个单独创建的 VM 实例,存在于我的 VM 实例中,是从之前的教程创建的。不确定这是否与错误有关。提前致谢。
我正在从头开始编写一个简单的神经网络。神经网络是用一种方法实现的simple_1_layer_classification_NN。对于每个 Epoch(神经网络的训练运行),正如您从for loop(在下面的代码中)看到的那样,我将成本(误差范围)值附加到数组中costs。问题是训练次数可能多达数千甚至数百万。这意味着costs数组可以附加很多cost元素。
因为我不想在图表上绘制数千或数百万个数据点,所以我想做的是,无论数组中有多少元素costs,我只想从中绘制 100 个数据点,展开尽可能平等。例如,如果有 10 个元素,则绘制所有 10 个元素。如果有 100 个元素,则绘制所有 100 个元素。任何高于 100 的值,仅绘制等间隔的 100 个数据点。例如,每隔一个数据点绘制 200 个图。如果为 500,则每隔 5 个元素绘制一次。即使有 102 个元素,也只绘制 100 个数据点,并尽可能间隔开。我希望这是有道理的。这可以吗?请注意,我只包含与问题最相关的部分代码。如果有带点的注释,# ......我只是表明这里有代码,但我没有包含它,因为它与问题无关。
非常感谢您的帮助。
def simple_1_layer_classification_NN(self, dataset_input_matrix, output_data_labels, input_dimension, epochs, activation_func='sigmoid', learning_rate=0.2, cost_func='squared_error'):
# ...............
cost = float()
costs = []
# ................
# We perform the training based on the number of epochs specified
for i in range(epochs):
#....................
# …Run Code Online (Sandbox Code Playgroud) 我的 Mongoose 代码位于单独的model.js文件中,而用于处理 http 请求的 Express 代码位于app.js. 我只是在为一个虚构的 wiki 文章网站练习创建 API 并在 Postman 上测试它们。我正在努力让它工作的 api 正在删除一篇文章。(注意:为了简洁起见,我只包含了有问题的代码,即app.delete(\'/articles/:id\' ....from app.js,以及它调用的静态方法model.js ,以及它从-deleteOneArticleFromDB(articleID)
app.js:
const express = require(\'express\');\nconst bodyParser = require(\'body-parser\');\nconst model = require(\'./model\');\n\nconst app = express();\n\napp.use(bodyParser.urlencoded({ extended: true }));\n\napp.delete(\'/articles/:id\', async (req, res) => {\n const articleID = req.params.id;\n console.log(`req.params.id: ${req.params.id}`);\n try {\n const response = await model.DBUtility.deleteOneArticleFromDB(articleID);\n res.status(200).json({message: response, app: \'wiki-api\'});\n } catch (err) {\n res.json({message: err, app: \'wiki-api\'});\n }\n});\n\nconst port …Run Code Online (Sandbox Code Playgroud) 我使用的是 Windows 10(版本 10.0.17763 内部版本 17763)。我正在尝试使用 NPM 通过 Nodejs Express 服务器安装 Bcrypt。我已经更新了最新的 Nodejs 版本(v12.16.3)。无论我安装最新版本的 Bcrypt 还是早期版本,我总是遇到相同的错误:
node-pre-gyp\bin\node-pre-gyp我不知道为什么它在 directoy 中寻找C:\Users\hazzaldo\Desktop\web-dev-udemy-course\。那里没有这样的目录!这只是一个存储我的课程文件的文件夹。
我也不确定为什么会发生这种情况:
-Security\store-confidential-data-web-app\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file
Run Code Online (Sandbox Code Playgroud)
我在其他论坛中查找过此类错误,但没有解决方案对我有帮助。有些是旧论坛,要求安装已弃用的模块。
node.js ×2
bcrypt ×1
express ×1
javascript ×1
matplotlib ×1
mongodb ×1
mongoose ×1
npm ×1
numpy ×1
python ×1