我正在尝试在本地计算机上执行 tensorflow 脚本。但出现以下警告。如果有人可以指定此警告的常见原因是什么,那将非常有帮助。
2020-10-26 14:04:34.690753: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2020-10-26 14:04:34.707717: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fadab4339f0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-10-26 14:04:34.707751: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Run Code Online (Sandbox Code Playgroud)
我尝试跟踪我的代码,这是给出错误的行:
model = load_model(MODEL_PATH)
Run Code Online (Sandbox Code Playgroud)
我load_model使用导入 …
我正在尝试使用 AJAX 调用在我的 chrome 扩展的 Javascript 前端和我计划使用我的机器学习代码的 Flask API 之间来回发送数据。
内容.js
console.log("Application GO");
function colorChanger() {
let tweets = document.querySelectorAll("article");
tweets.forEach(function (tweet) {
$(document).ready(function () {
$.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
url: "/_api_call",
traditional: "true",
data: JSON.stringify({tweet}),
dataType: "json"
});
});
tweet.setAttribute("style", "background-color: red;");
});
}
let timer = setInterval(colorChanger, 2000);
Run Code Online (Sandbox Code Playgroud)
烧瓶代码
from flask import Flask, flash, request, redirect, url_for
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/_api_call', methods=['GET'])
def fake_news_detector():
data = request.get_json()
with open('temp.txt', 'w') as f: …Run Code Online (Sandbox Code Playgroud)