Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >val_acc高,但实际精度低

val_acc高,但实际精度低
EN

Stack Overflow用户
提问于 2018-03-10 12:46:22
回答 1查看 1.3K关注 0票数 1

我一直遵循来自本网站的代码来训练一个能区分10个猴子物种的CNN。在训练阶段,我取得了不错的成绩,有三个时代:

代码语言:javascript
运行
AI代码解释
复制
Using TensorFlow backend.
Found 1097 images belonging to 10 classes.
Found 272 images belonging to 10 classes.
Epoch 1/3
46/46 [==============================] - 24s 521ms/step - loss: 1.4526 - acc: 0.5644 - val_loss: 0.5665 - val_acc: 0.9688
Epoch 2/3
46/46 [==============================] - 20s 445ms/step - loss: 0.5706 - acc: 0.8983 - val_loss: 0.4078 - val_acc: 0.9375
Epoch 3/3
46/46 [==============================] - 21s 449ms/step - loss: 0.3696 - acc: 0.9447 - val_loss: 0.4832 - val_acc: 0.8438

然后,我编写了一个预测脚本,该脚本查看一个目录,并从保存的模型中进行预测。我试着把它指向培训和验证文件夹,但这两种结果在16%的时间里似乎都是正确的。为什么我的val_acc在训练中看起来很高,但是当我实际使用模型来做预测时,它的表现很差?

下面是预测循环:

代码语言:javascript
运行
AI代码解释
复制
inputSize = (300, 400, 3)
for count, path in enumerate(allImages):
    img= cv2.imread(path)

    img = cv2.resize(img, (inputSize[0], inputSize[1]))
    img = np.reshape(img, (1, inputSize[0], inputSize[1], inputSize[2]))

    correct = path.split(os.path.sep)[-2] #get label from directory
    classes = labels[model.predict(img)[0].argmax(axis=0)]

    if args.show_predictions: #display prediction in a window
        fontSize = 0.8
        black = (0, 0, 0)
        white = (255, 255, 255)

        orig = cv2.resize(orig, (480, 480))
        cv2.putText(orig, 'prediction: {}'.format(classes), (0, 20),
            cv2.FONT_HERSHEY_SIMPLEX, fontSize, black, 10)
        cv2.putText(orig, 'prediction: {}'.format(classes), (0, 20),
            cv2.FONT_HERSHEY_SIMPLEX, fontSize, white, 2)

        cv2.putText(orig, 'answer: {}'.format(correct), (0, orig.shape[0] - 10),
            cv2.FONT_HERSHEY_SIMPLEX, fontSize, black, 10)
        cv2.putText(orig, 'answer: {}'.format(correct), (0, orig.shape[0] - 10),
            cv2.FONT_HERSHEY_SIMPLEX, fontSize, white, 2)
        cv2.imshow('prediction', orig)
        if cv2.waitKey(0) == ord('q'):
            break

    if args.verbose:
        print('prediction: {} --> answer: {}'.format(classes, correct))

    if classes == correct:
        totalCorrect += 1

    counter += 1
    if count%verbosity == 0:
        print('Predicting image {} out of {}'.format(count, len(allImages)))

print('total correct: {}/{} - {}%'.format(totalCorrect, counter, int(totalCorrect/counter * 100)))
cv2.destroyAllWindows()

基本上,它从目录中读取标签,并将其与我前面在脚本中创建的label列表进行比较。

在运行带有培训数据的脚本(我认为它会很高,因为它是在它上的训练)时,我得到:

代码语言:javascript
运行
AI代码解释
复制
Predicting image 600 out of 1097
Predicting image 650 out of 1097
Predicting image 700 out of 1097
Predicting image 750 out of 1097
Predicting image 800 out of 1097
Predicting image 850 out of 1097
Predicting image 900 out of 1097
Predicting image 950 out of 1097
Predicting image 1000 out of 1097
Predicting image 1050 out of 1097
total correct: 161/1097 - 14%

是什么使训练的准确性高,但在实践中却很低?

编辑:在详细模式下运行脚本:

代码语言:javascript
运行
AI代码解释
复制
Predicting image 0 out of 272
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: bald_uakari --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: bald_uakari --> answer: bald_uakari
prediction: japanese_macaque --> answer: bald_uakari
prediction: japanese_macaque --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: white_headed_capuchin --> answer: bald_uakari
prediction: bald_uakari --> answer: bald_uakari
prediction: white_headed_capuchin --> answer: bald_uakari
prediction: japanese_macaque --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: japanese_macaque --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: bald_uakari
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
Predicting image 50 out of 272
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: common_squirrel_monkey --> answer: black_headed_night_monkey
prediction: nilgiri_langur --> answer: common_squirrel_monkey
prediction: japanese_macaque --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: white_headed_capuchin --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: pygmy_marmoset --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: nilgiri_langur --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: white_headed_capuchin --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: nilgiri_langur --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: common_squirrel_monkey
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: pygmy_marmoset --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: pygmy_marmoset --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
Predicting image 100 out of 272
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: japanese_macaque --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: japanese_macaque
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: japanese_macaque --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: mantled_howler
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: white_headed_capuchin --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: white_headed_capuchin --> answer: nilgiri_langur
Predicting image 150 out of 272
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: nilgiri_langur
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: japanese_macaque --> answer: patas_monkey
prediction: nilgiri_langur --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: nilgiri_langur --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: nilgiri_langur --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: japanese_macaque --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: pygmy_marmoset --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: patas_monkey
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
Predicting image 200 out of 272
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: pygmy_marmoset --> answer: pygmy_marmoset
prediction: japanese_macaque --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: japanese_macaque --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: nilgiri_langur --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: common_squirrel_monkey --> answer: pygmy_marmoset
prediction: white_headed_capuchin --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: nilgiri_langur --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: japanese_macaque --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: nilgiri_langur --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: patas_monkey --> answer: silvery_marmoset
prediction: japanese_macaque --> answer: silvery_marmoset
prediction: japanese_macaque --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: japanese_macaque --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: silvery_marmoset
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: white_headed_capuchin --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: white_headed_capuchin --> answer: white_headed_capuchin
Predicting image 250 out of 272
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: white_headed_capuchin --> answer: white_headed_capuchin
prediction: white_headed_capuchin --> answer: white_headed_capuchin
prediction: white_headed_capuchin --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: japanese_macaque --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: pygmy_marmoset --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: white_headed_capuchin --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
prediction: common_squirrel_monkey --> answer: white_headed_capuchin
total correct: 41/272 - 15%
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-14 00:20:38

所以,事实证明,我使用了错误的通道输入模式。我使用的预先训练过的网络名为resnet50,它使用caffec样式的输入。

解决方案是从keras导入preprocess_image(),然后运行

img = preprocess_image(img)

另一个因素是我用cv2.imread加载图像。我不确定,但是这可能使用了resnet50所要求的错误的通道格式。另一种方法是使用keras的load_img()函数。

结论: val_acc在训练中普遍正确。如果您的预测精度很低,这可能是一个数据输入问题!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49213870

复制
相关文章
使枚举类型的选项在VS的属性窗里显示为中文
我们自己做的组件,一般希望它的属性在设计时能够在属性窗里显示为中文,可以在属性上添加System.ComponentModel.DisplayNameAttribute标注达到这个目的。但是,枚举的选项如何以中文的形式显示在属性窗里呢?
明年我18
2019/09/18
1.2K0
使枚举类型的选项在VS的属性窗里显示为中文
javascript表单提交的内容显示在表格中
实现三个文本域的内容提交之后显示在表格中,代码直接用文本文件运行,记得后缀改为.html 运行结果
别团等shy哥发育
2023/02/27
8.1K0
javascript表单提交的内容显示在表格中
R语言提取PDF文件中的文本内容
综上步骤,我们便可以随便获取任意章节的任意内容。那么接下来就是对这些文字的应用,各位集思广益吧。
一粒沙
2019/07/31
10K1
如何使特定的数据高亮显示?
当表格里数据比较多时,很多时候我们为了便于观察数据,会特意把符合某些特征的数据行高亮显示出来。这不,公司的HR小姐姐就有这个需求,说她手头上有一份招聘数据,她想把“薪水”超过20000的行突出显示出来,应该怎么操作呢?
猴子聊数据分析
2020/02/26
5.9K0
R中的向量化运算
1、R中的向量化运算-seq seq(1, 10, by=1) seq(1, 10, by=0.1) seq(1.9, 10, by=0.1) #注意,不能这样子递减 seq(10, 1, by=0.1) #注意,你可以这样子递减 seq(10, 1, by=-0.1) #除了设置步长,还可以设置均分的步数 seq(10, 1, length.out=10) seq(10, 1, length.out=100) seq(10, 1, length.out=91) #数清楚里面的个数 2、R中
Erin
2018/01/09
2.1K0
"0.1"在PL/SQL Developer和sqlplus中如何不显示为".1"?
微信群有朋友问,PL/SQL Developer显示0.1的时候自动将0删除,即".1",因此有什么方法,可以显示小数点之前的0?
bisal
2019/01/30
2.1K0
在 Linux 中如何按名称和 Grep 内容查找文件?
如果您使用该find命令递归搜索某些文件,然后将结果通过管道传递给该grep命令,那么您实际上将解析文件路径/名称,而不是它们的内容。
网络技术联盟站
2022/05/11
6.9K0
在 Linux 中如何按名称和 Grep 内容查找文件?
cat命令 – 在终端设备上显示文件内容
Linux系统中有很多个用于查看文件内容的命令,每个命令又都有自己的特点,比如这个cat命令就是用于查看内容较少的纯文本文件的。cat这个命令也很好记,因为cat在英语中是“猫”的意思,小猫咪是不是给您一种娇小、可爱的感觉呢?
用户4988085
2021/07/24
1.7K0
MATLAB中向量_向量法表示字符串
matlab中的向量是只有一行元素的数组,向量中的单个项通常称为元素。Matlab中的向量索引值从1开始,而不是从0开始。
全栈程序员站长
2022/11/17
2.4K0
MATLAB中向量_向量法表示字符串
linux 查看文件内容 显示行号
linux 系统中文件内容显示行号分为临时显示和永久显示两种,本文对两种方式进行介绍
全栈程序员站长
2022/06/25
15.3K0
linux 查看文件内容 显示行号
Python把PDF文件中每页内容分离为独立图片文件
封面图片:《Python程序设计实验指导书》(ISBN:9787302525790),董付国,清华大学出版社
Python小屋屋主
2019/07/23
1.5K0
Python把PDF文件中每页内容分离为独立图片文件
每日一题--4--在两个文件中取交集,显示指定的内容
把这个两个文件都存在的用户的密码输出出来 [root@sentinel student]# head file1 file2 ==> file1 <== oldboy 1234 alex 4567 lidao 9999 ==> file2 <== 001 lidao 002 alex 003 oldboy 004 oldgirl 提示:需要用到如何判断这两个文件不是一个文件。 解题思路 awk 'FNR==NR{h[$1]=$2}FNR!=NR{print h[$2]}' file1 fi
张琳兮
2019/03/14
1.4K0
在DragonOS中,使蜂鸣器发声
很简单,代码如下: void beep(uint64_t times) { io_out8(0x43, 182&0xff); io_out8(0x42, 2280&0xff); io_out8(0x42, (2280>>8)&0xff); uint32_t x = io_in8(0x61)&0xff; x |= 3; io_out8(0x61, x&0xff); times *= 10000; for(uint64_t i=0;i<times
灯珑LoGin
2022/10/31
4310
转义字符'\r'在Python内置函数print()中的妙用
在Python 3.x中,内置函数print()用来实现格式化输出,各参数含义请参考本文末尾的相关阅读。本文重点介绍print()函数的end参数以及转义字符'\r'的妙用。 本文末尾的相关阅读中已经
Python小屋屋主
2018/04/16
4.3K0
转义字符'\r'在Python内置函数print()中的妙用
如何将文件内容转成String字符串
以上两种方式从编码简洁度来讲,肯定是第二种好很多,但其实性能是差不多的,一个是牺牲了读的性能,另一个是牺牲了写的性能。
Java深度编程
2020/06/10
3.6K0
R沟通|​在Rstudio中运行tex文件
这期主要介绍下如何在Rstudio中运行和使用.tex文件,并给大家安利一个非常nice的模板和根据该模板制作的案例。
庄闪闪
2021/04/09
4K0
如何使用EvilTree在文件中搜索正则或关键字匹配的内容
 关于EvilTree  EvilTree是一款功能强大的文件内容搜索工具,该工具基于经典的“tree”命令实现其功能,本质上来说它就是“tree”命令的一个独立Python 3重制版。但EvilTree还增加了在文件中搜索用户提供的关键字或正则表达式的额外功能,而且还支持突出高亮显示包含匹配项的关键字/内容。  工具特性  1、当在嵌套目录结构的文件中搜索敏感信息时,能够可视化哪些文件包含用户提供的关键字/正则表达式模式以及这些文件在文件夹层次结构中的位置,这是EvilTree的一个非常显著的优势;
FB客服
2023/03/29
4.2K0
如何使用EvilTree在文件中搜索正则或关键字匹配的内容
获取类路径某个json文件中的内容字符串
实际项目中可能会有需要读取类路径下面的配置文件中的内容的需求,由于springboot项目打包的是jar包,通过文件读取获取流的方式开发的时候没有问题,但是上到linux服务器上就有问题了,对于这个问题记录一下处理的方式
在水一方
2022/09/16
2.8K0
点击加载更多

相似问题

EventKit框架中的Snooze方法?

20

Google错误“多个命名为'initWithArray:‘的方法”

30

eventKit教程

21

EventKit权限

121

EventKit提醒

11
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档