我正在使用https://godbolt.org/编译一个简单的 C++ 脚本,但即使是最简单的
int main()
{
std::cout << "Hello World!" << std::endl;
}
Run Code Online (Sandbox Code Playgroud)
当我点击时Add new... --> Compiler --> Output我得到:Compiler returned: 0
我检查了我的pip3和python3版本:
(tensorflow) MacBook-Pro-de-Hector-2:tensorflow hectoresteban$ pip3 -V
pip 10.0.1 from /Users/hectoresteban/.virtualenvs/tensorflow/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip (python 3.7)
(tensorflow) MacBook-Pro-de-Hector-2:tensorflow hectoresteban$ python3 -V
Python 3.7.0
Run Code Online (Sandbox Code Playgroud)
在我目前正在使用的虚拟环境中:
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl
Run Code Online (Sandbox Code Playgroud)
以标准方式pip3 install tensorflow输出以下消息:
could not find a version that satisfies the requirement tensorflow (from versions: )
Run Code Online (Sandbox Code Playgroud)
安装后使用第一种方法解释:
(tensorflow) MacBook-Pro-de-Hector-2:tensorflow hectoresteban$ python3
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/hectoresteban/.virtualenvs/tensorflow/lib/python3.7/site-packages/tensorflow/__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/Users/hectoresteban/.virtualenvs/tensorflow/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module> …Run Code Online (Sandbox Code Playgroud) 我正在按照 Firebase 官方频道 ( https://firebase.google.com/docs/auth/ios/google-signin?hl=en-419 )的说明使用 Google 身份验证订阅我的应用。问题出现在函数中
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?)
Run Code Online (Sandbox Code Playgroud)
它没有从命令解析标识符 GoogleAuthProvider 和 Auth 的地方。即“使用未解析的标识符‘GoogleAuthProvider’”
let credential = GoogleAuthProvider.credential(idToken: authentication.idToken, accessToken: authentication.accessToken)
// ...
Auth.auth().signIn(with: credential) { (user, error) in
if let error = error {
// ...
return
}
Run Code Online (Sandbox Code Playgroud)
我在查看器和 AppDelegate 中都导入了:
import Firebase
import GoogleSignIn
Run Code Online (Sandbox Code Playgroud)
我的 Podfile 看起来像这样:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'racc' do
# Comment …Run Code Online (Sandbox Code Playgroud) google-authentication ios firebase firebase-authentication swift4
我为 ROS2 创建了一个包,并添加了一个我下载的 Python 存储库。我遇到的问题是,在原始存储库中,自己的存储库中的模块是直接导入的,而在我的存储库中,我必须导入它们,并在模块前添加 ROS2 包名称,即使我是从同一个存储库导入模块,例如:
import planner_pkg.SimpleOneTrailerSystem as SimpleOneTrailerSystem
虽然我想:
import SimpleOneTrailerSystem
我的 ROS2 项目结构是这样的:
ros2_ws
src
planner
planner_pkg
__init__.py
SimpleOneTrailerSystem.py
planner_node.py
...
package.xml
setup.py
Run Code Online (Sandbox Code Playgroud)
包.xml
<?xml version="1.0"?>
<package format="2">
<name>planner_pkg</name>
<version>0.0.1</version>
<description>This package contains algorithm for park planner</description>
<maintainer email=""></maintainer>
<license>Apache License 2.0</license>
<exec_depend>rclpy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<!-- These test dependencies are optional
Their purpose is to make sure that the code passes the linters -->
<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>python3-pytest</test_depend>
<export>
<build_type>ament_python</build_type>
</export>
</package>
Run Code Online (Sandbox Code Playgroud)
设置.py:
from setuptools import setup …Run Code Online (Sandbox Code Playgroud) 我正在尝试https://pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.html中提供的示例,但我使用的是 LSTM 模型而不是 RNN。该数据集由不同的名称(不同大小)及其对应的语言(语言总数为18种)组成,目标是训练一个模型,给定某个名称输出其所属的语言。
我现在的问题是:
(#characters of name, #target classes)但我只想获取形状(1,#target of classes),以便确定每个名称对应于哪个类。我试图只得到最后一行,但结果非常糟糕。class LSTM(nn.Module):
def __init__(self, embedding_dim, hidden_dim, vocab_size, tagset_size):
super(LSTM, self).__init__()
self.hidden_dim = hidden_dim
self.word_embeddings = nn.Embedding(vocab_size, embedding_dim)
# The LSTM takes word embeddings as inputs, and outputs hidden states
# with dimensionality hidden_dim.
self.lstm = nn.LSTM(embedding_dim, hidden_dim)
# The linear layer that maps from hidden state space to tag space
self.hidden2tag = nn.Linear(hidden_dim, …Run Code Online (Sandbox Code Playgroud) Installation Instructions我正在关注https://argoproj.github.io/argo-cd/getting_started/#3-access-the-argo-cd-api-server
,即使服务类型已更改为LoadBalancer我无法登录。
我掌握的信息是:
$ oc describe svc argocd-server
Name: argocd-server
Namespace: argocd
Labels: app.kubernetes.io/component=server
app.kubernetes.io/name=argocd-server
app.kubernetes.io/part-of=argocd
Annotations: <none>
Selector: app.kubernetes.io/name=argocd-server
Type: LoadBalancer
IP: 172.30.70.178
LoadBalancer Ingress: a553569222264478ab2xx1f60d88848a-642416295.eu-west-1.elb.amazonaws.com
Port: http 80/TCP
TargetPort: 8080/TCP
NodePort: http 30942/TCP
Endpoints: 10.128.3.91:8080
Port: https 443/TCP
TargetPort: 8080/TCP
NodePort: https 30734/TCP
Endpoints: 10.128.3.91:8080
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
Run Code Online (Sandbox Code Playgroud)
如果我做:
$ oc login https://a553569222264478ab2xx1f60d88848a-642416295.eu-west-1.elb.amazonaws.com
The server is using a certificate that does not match its hostname: x509: certificate …Run Code Online (Sandbox Code Playgroud) python ×3
argocd ×1
c++ ×1
firebase ×1
godbolt ×1
import ×1
ios ×1
kubernetes ×1
lstm ×1
macos ×1
pip ×1
python-3.7 ×1
python-3.x ×1
pytorch ×1
ros2 ×1
swift4 ×1
tensorflow ×1