小编pre*_*tor的帖子

尚未找到 PyTorch 和 TensorFlow >= 2.0。模型将不可用,只能使用分词器、配置和文件/数据实用程序

我正在尝试使用 pip 安装变压器

pip install transformers
Run Code Online (Sandbox Code Playgroud)

进口变压器后

这个错误显示

Neither PyTorch nor TensorFlow >= 2.0 have been found.Models won't be available and only tokenizers, configuration, and file/data utilities can be used.
Run Code Online (Sandbox Code Playgroud)

虽然我安装 TensorFlow-GPU= 2.3.1 并使用 conda

系统信息

Windows 10 
python 3.6
cuda 10.1
tensorflow-gpu= 2.3.1
Run Code Online (Sandbox Code Playgroud)

python nlp tensorflow

22
推荐指数
2
解决办法
3万
查看次数

Keras尝试保存并加载模型错误您正在尝试将包含16层的权重文件加载到具有0层的模型中

我正在尝试微调并在 Keras 中保存模型并加载它,但我收到此错误:
Value Error: You are trying to load a weight file containing 16 layers into a model with 0 layers.
我尝试了另一个数字模型 我尝试采用 vgg16 时将其保存并加载模式工作而没有错误,它给出了该错误
我想要加载模型,但由于此错误而无法加载。任何人都可以帮忙吗?

import keras
from  keras.models import Sequential,load_model,model_from_json

from keras import backend as K
from keras.layers import Activation,Conv2D,MaxPooling2D,Dropout
from keras.layers.core import Dense,Flatten
from keras.optimizers import Adam
from keras.metrics import categorical_crossentropy
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import *
from keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
import itertools
from sklearn.metrics import confusion_matrix

import numpy as …
Run Code Online (Sandbox Code Playgroud)

python theano deep-learning keras tensorflow

6
推荐指数
2
解决办法
1万
查看次数

在 html 中使用 iframe 播放视频

我想播放视频,但只能下载。

这是我的代码:

<iframe src="videos/1.mp4" width="540" height="310"></iframe>
Run Code Online (Sandbox Code Playgroud)

页面加载时的结果是:

加载页面时的图像

如何使用 iframe 而不是 video 标签播放视频?

html video iframe

4
推荐指数
2
解决办法
8万
查看次数

在Android中通过OpenCV进行Android眼睛检测和跟踪来实现睁眼和闭眼

我通过单击此链接链接进行了应用程序的眼睛检测,并且它
如何工作才能检测到眼睛是否睁开?android中是否有库来检测关闭或打开

java android opencv face-detection eye-tracking

2
推荐指数
1
解决办法
2876
查看次数

faiss 错误:找不到满足 faiss 要求的版本(来自版本:无)

运行安装时:

pip install faiss
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

ERROR: Could not find a version that satisfies the requirement faiss (from versions: none)
ERROR: No matching distribution found for faiss
Run Code Online (Sandbox Code Playgroud)

当我使用 conda 时:

conda install faiss
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

PackagesNotFoundError: The following packages are not available from current channels:

  - faiss
Run Code Online (Sandbox Code Playgroud)

python pip python-3.x anaconda faiss

2
推荐指数
2
解决办法
3596
查看次数

JavaScript中的Sin和cos

我正在尝试用JavaScript构建计算器.它除了罪和cos之外都有效,它们给出了错误和意想不到的结果.

Sin和Cos给出了错误的结果

罪(180)= 0

在代码sin(180)= - 0.8011526357338304

在此输入图像描述

我的代码如下所示,

JavaScript的:

function d(val){
    if(val=="sin"){
        var x=document.getElementById("d").value;
        document.getElementById("d").value=Math.sin(x);
    }
    if(val=="cos"){
        var x=document.getElementById("d").value;
        document.getElementById("d").value=Math.cos(x);
    }
    if(val=="envers"){
        var x=document.getElementById("d").value;
        document.getElementById("d").value=eval(1/x);
    }
    if(val=="sqrt"){
        var x=document.getElementById("d").value;
        document.getElementById("d").value=Math.sqrt(x);
    }
}

function c(val){
    document.getElementById("d").value=val;
}

function v(val){
    document.getElementById("d").value+=val;
}

function e(){ 
    try { 
      c(eval(document.getElementById("d").value)) 
    } 
    catch(e){
        c('Error') 
    } 
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div class="display">
    <p>
        <input type="text" readonly size="14" id="d">
        <input type="button" class="button black" value="C" onclick='c("")'>  
    </p>
</div>
<div class="keys">
    <p>
        <input type="button" class="button black" value="1" onclick='v("1")'>
        <input type="button" …
Run Code Online (Sandbox Code Playgroud)

javascript

-1
推荐指数
1
解决办法
2454
查看次数