我是TensorFlow的新手.我最近安装了它(Windows CPU版本)并收到以下消息:
成功安装了tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc2
然后,当我试图跑
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
sess.run(hello)
'Hello, TensorFlow!'
a = tf.constant(10)
b = tf.constant(32)
sess.run(a + b)
42
sess.close()
Run Code Online (Sandbox Code Playgroud)
(我通过https://github.com/tensorflow/tensorflow找到)
我收到以下消息:
2017-11-02 01:56:21.698935:IC:\ tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137]你的CPU支持这个说明TensorFlow二进制文件未编译使用:AVX AVX2
但是当我跑的时候
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
Run Code Online (Sandbox Code Playgroud)
它运行应该和输出Hello, TensorFlow!
,这表明安装确实成功,但还有其他错误.
你知道问题是什么以及如何解决它?谢谢.
如何在不使用getElementById
方法的情况下测试元素是否存在?我已经设置了一个现场演示供参考.我也会在这里打印代码:
<!DOCTYPE html>
<html>
<head>
<script>
var getRandomID = function (size) {
var str = "",
i = 0,
chars = "0123456789abcdefghijklmnopqurstuvwxyzABCDEFGHIJKLMNOPQURSTUVWXYZ";
while (i < size) {
str += chars.substr(Math.floor(Math.random() * 62), 1);
i++;
}
return str;
},
isNull = function (element) {
var randomID = getRandomID(12),
savedID = (element.id)? element.id : null;
element.id = randomID;
var foundElm = document.getElementById(randomID);
element.removeAttribute('id');
if (savedID !== null) {
element.id = savedID;
}
return (foundElm) ? false : true; …
Run Code Online (Sandbox Code Playgroud) 假设我有一个如下定义的Python函数:
def foo(arg1,arg2):
#do something with args
a = arg1 + arg2
return a
Run Code Online (Sandbox Code Playgroud)
我可以使用函数的名称foo.func_name
.如上所示,我如何以编程方式获取其源代码?
我有一张表格.在那个表格之外,我有一个按钮.一个简单的按钮,如下所示:
<button>My Button</button>
Run Code Online (Sandbox Code Playgroud)
然而,当我点击它时,它会提交表单.这是代码:
<form id="myform">
<input />
</form>
<button>My Button</button>
Run Code Online (Sandbox Code Playgroud)
所有这个按钮应该是一些JavaScript.但即使它看起来像上面的代码,它提交表单.当我将标签按钮更改为span时,它可以完美地工作.但不幸的是,它需要成为一个按钮.有没有办法阻止该按钮提交表单?比如说
<button onclick="document.getElementById('myform').doNotSubmit();">My Button</button>
Run Code Online (Sandbox Code Playgroud) 我有以下工作树状态
$ git status foo/bar.txt
# On branch master
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# deleted by us: foo/bar.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)
文件foo/bar.txt
在那里,我想再次进入"未更改状态"(类似于'svn revert'):
$ git checkout HEAD foo/bar.txt
error: path 'foo/bar.txt' is unmerged
$ git reset HEAD foo/bar.txt
Unstaged changes after reset:
M foo/bar.txt
Run Code Online (Sandbox Code Playgroud)
现在它变得令人困惑:
$ git status foo/bar.txt
# …
Run Code Online (Sandbox Code Playgroud) 我正在尝试为我的应用程序强制"纵向"模式,因为我的应用程序绝对不是为"横向"模式设计的.
在阅读了一些论坛后,我在清单文件中添加了这些行:
<application
android:debuggable="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:screenOrientation="portrait">
Run Code Online (Sandbox Code Playgroud)
但它不适用于我的设备(HTC Desire).它从"纵向"lo"横向"切换,忽略清单文件中的行.
在更多论坛阅读之后,我尝试在我的清单文件中添加它:
<application
android:debuggable="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:configChanges="orientation"
android:screenOrientation="portrait">
Run Code Online (Sandbox Code Playgroud)
这个函数在我的activity类中:
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
Run Code Online (Sandbox Code Playgroud)
但同样,没有运气.
我想从命令行设置Android dev环境,遇到以下问题:
wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz
Run Code Online (Sandbox Code Playgroud)
解压缩文件后,运行
tools/android update sdk --no-ui
Run Code Online (Sandbox Code Playgroud)
但是,跑步太慢了
Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml
Run Code Online (Sandbox Code Playgroud)
结果是文件夹构建工具中没有任何内容,我想要的是aapt和apkbuilder,因为我想在没有ant的情况下从命令行构建apk.
最近我意识到,一些adblocker扩展(例如adBlocker plus)阻止了一些Ajax调用.我在控制台上遇到了这个错误:
GET http://localhost/prj/conn.php?q=users/list/ net::ERR_BLOCKED_BY_CLIENT
Run Code Online (Sandbox Code Playgroud)
为什么它会阻止某些Ajax调用而不是其他调用,以及导致这种情况的原因 除了告诉用户关闭adblocker之外,还有其他解决方法吗?
在办公室,我们正在编写一个应用程序,它将根据我们给出的模式生成XML文件.我们在.XSD文件中有架构.
是否有可用于自动化测试的工具或库来检查生成的XML是否与模式匹配?
我们更喜欢适合商业用途的免费工具,尽管我们不会捆绑架构检查器,因此开发期间只需要开发人员可以使用它.
我们的开发语言是C++,如果这有什么不同,虽然我不认为它应该生成xml文件然后通过在测试中调用单独的程序来进行验证.
我想知道是否有人能够帮助我在我的计算机上登录帐户时运行.sh文件.我正在运行Mac OS X 10.6.7.
我有一个文件"Example.sh",我想在我登录计算机时运行.我已登录时运行它没有问题,但我想让它自动运行.
人们说要将它添加到登录shell文件中,但我不知道它在哪里.请帮忙.
android ×2
javascript ×2
aapt ×1
ajax ×1
avx ×1
bash ×1
build-tools ×1
cpu ×1
dom ×1
element ×1
exists ×1
function ×1
git ×1
git-checkout ×1
git-reset ×1
html ×1
landscape ×1
login ×1
orientation ×1
portrait ×1
python ×1
schema ×1
screen ×1
sdk ×1
shell ×1
tensorflow ×1
terminal ×1
validation ×1
variables ×1
xml ×1
xsd ×1