kernel

(梳理)用Tensorflow实现SE-ResNet50(SENet ResNet ResNeXt VGG16)的数据输入,训练,预测的完整代码框架(cifar10准确率90%)

[亡魂溺海] 提交于 2020-02-29 13:55:27
//之前的代码有问题,重发一遍 这里做个整理,打算给一个ResNet的完整代码实现 当然也包括ResNeXt和SENet 其中SE-ResNeXt是最后一届ImageNet比赛的冠军模型 当然可能我写得烂……参数没精调…准确率提升也不是很明显 首先是数据处理部分,我自己实现过几个框架 多线程数据读入和处理框架(tf.data) 较早版本的队列多线程读入处理框架 最普通的单线程(用法和自带MNIST一样)读取数据 我用了多线程tf.data Cifar10原生数据集是python打包的 至于图片的话, 参考我的这篇 ,把Cifar10图片提取出来 主要是为了制成TFRecord格式,这样数据读取速度会很快(毕竟自家的东西优化得给足) VGG AlexNet之前已经跑过了就不跑了,滑动平均下准确率已经在85%以上了 AlexNet VGG16 不过我的网络看起来更像是全卷积网络FCN 原始的网络带有全连接层,但我用全局平均池化+1x1卷积代替全连接层,同时还加上了BN,SENet等后来才有的结构 准确率都能跑到85%以上 比较深的网络(VGG19)不加上BN很难收敛,我跑Kaggle的时候跑了10个epoch还是50%的准确率 SENet感觉像是一种Attention机制 ResNet和 ResNeXt 的差别不是很大,有点像Inception 不过每个通路都是完全一样的

Ubuntu14.04下kpatch源码安装使用

梦想的初衷 提交于 2020-02-29 09:00:53
背景   Kpatch是给Linux内核打热补丁的工具,所谓热补丁,就是指打完补丁后,补丁可立即生效,而不需要像传统打补丁那样必须重启Linux才能生效。 Kpatch简介   最早出现的打热补丁工具不是Kpatch,而是Ksplice。但是Ksplice被Oracle收购后,一些发行版生产商就不得不开发自己的热补丁工具,分别是Redhat的Kpatch和Suse的KGraft。同时,在这两家厂商的推进下,kernel4.0开始,开始集成了livepatch技术,该技术和其他热补丁技术类似。   Kpatch虽然是Redhat研发,但其也支持Ubuntu、Debian、Oracle Linux等的发行版,本文将介绍在 Ubuntu14.04 下安装和使用Kpatch软件。 不足   热补丁不是万能的,尤其是现在技术还不足够成熟的时候。在使用Kpatch热补丁前,我们需要知道Kpatch的不足之处:     1.如果在已经打过patch的环境继续打patch,那么新patch必须是基于上个patch打的补丁。     2.不支持修改数据结构的patch,如果有这样的patch,用户必须改代码。     3. 不支持修改__init函数的补丁。     4.不支持修改静态数据。     5.不支持修改vdso的函数,因为其运行在用户空间。 准备   注意

From PowerOn to Android – The Boot Sequence

北战南征 提交于 2020-02-29 04:29:00
现在的arm soc嵌入式系统,如android设备,启动过程虽然各个soc均有差异,但大体一致.即有一段程序内置在soc的rom中,可根据外接管脚的选择不同的启动设备,如内部nand,sd卡,u盘等,这段代码可以认为bootloader0,大多数情况下,这段代码很精简,不会识别分区格式(树莓派除外),这段精简代码在soc内部的sram执行,从启动设备的某个固定地址读取一定大小的数据,这段数据可以认为时bootloader1,这段代码一般负责初始化基本时钟和dram控制器,然后读取bootloader2,bootload2一般具有基本的设备驱动程序,如uart/屏幕/存储设备,通过这些基本的驱动,识别分区,打印log,加载内核. 当内核加载后,内核具有编译进内核本身的基本驱动如存储设备和文件系统,串口,从而可以打印log到屏幕或串口.之后初始化各种外设后挂载rootfs.之后可以加载动态内核模块,执行init进程,最终进入系统. One of the main issues when dealing when embedded systems -specially as an amateur developer- is understanding what happens since our board/tablet/phone/etc (we will refer to is

Linux trace使用入门

吃可爱长大的小学妹 提交于 2020-02-28 06:22:43
概念 trace 顾名思义追踪信息,可通俗理解为一种高级打印机制,用于debug,实现追踪kernel中函数事件的框架。源代码位于:\kernel\trace\trace.c,有兴趣能够研究 撰写不易,转载需注明出处: http://blog.csdn.net/jscese/article/details/46415531 本文来自 【jscese】 的博客。 终端使用 须要文件系统挂载完毕之后,kernel的debugfs 挂载到 /sys/kernel/debug ,也可用命令挂载,一般都是在.rc中: mount debugfs none /sys/kernel/debug 列出文件夹下文件: root@:/sys/kernel/debug/tracing # ll -r--r--r-- root root 0 1970-01-01 08:00 README -r--r--r-- root root 0 1970-01-01 08:00 available_events -r--r--r-- root root 0 1970-01-01 08:00 available_tracers -rw-rw-r-- root shell 0 1970-01-01 08:00 buffer_size_kb -r--r--r-- root root 0 1970-01-01 08:00

Linux的进程管理

本秂侑毒 提交于 2020-02-27 18:29:12
copy from : http://gityuan.com/2017/08/05/linux-process-fork/ 基于Kernel 4.4源码 kernel/include/linux/sched.h kernel/include/linux/kthread.h kernel/arch/arm/include/asm/thread_info.h kernel/kernel/fork.c kernel/kernel/exit.c kernel/kernel/sched/core.c 一. 概述 Linux创建进程采用fork()和exec() fork: 采用复制当前进程的方式来创建子进程,此时子进程与父进程的区别仅在于pid, ppid以及资源统计量(比如挂起的信号) exec:读取可执行文件并载入地址空间执行;一般称之为exec函数族,有一系列exec开头的函数,比如execl, execve等 fork过程复制资源包括代码段,数据段,堆,栈。fork调用者所在进程便是父进程,新创建的进程便是子进程;在fork调用结束,从内核返回两次,一次继续执行父进程,一次进入执行子进程。 1.1 进程创建 Linux进程创建: 通过fork()系统调用创建进程 Linux用户级线程创建:通过pthread库中的pthread_create()创建线程 Linux内核线程创建:

apt 更新修复

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-26 01:25:30
想要更新docker版本不想内核上次卸载报错了,部分软件始终无法删除 **apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 7 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up grub-pc (2.02~beta2-36ubuntu3.23) ... /var/lib/dpkg/info/grub-pc.config: 12: /etc/default/grub: net.ifnames=0: not found dpkg: error processing package grub-pc (--configure): subprocess installed post-installation script

Miscellaneous Device Driver: Unable to open the device with open() system call

大兔子大兔子 提交于 2020-02-25 13:37:49
问题 I am trying to implement a system call interception for sys_open() call via kernel module and for that I have defined a miscellaneous device driver MyDevice which can be inserted as kernel module. Below is the code for my kernel module: #include <linux/version.h> #include <linux/module.h> #include <linux/miscdevice.h> #include <linux/fs.h> #include <linux/highmem.h> #include <asm/unistd.h> MODULE_LICENSE("GPL"); // IOCTL commands #define IOCTL_PATCH_TABLE 0x00000001 #define IOCTL_FIX_TABLE

Miscellaneous Device Driver: Unable to open the device with open() system call

☆樱花仙子☆ 提交于 2020-02-25 13:37:30
问题 I am trying to implement a system call interception for sys_open() call via kernel module and for that I have defined a miscellaneous device driver MyDevice which can be inserted as kernel module. Below is the code for my kernel module: #include <linux/version.h> #include <linux/module.h> #include <linux/miscdevice.h> #include <linux/fs.h> #include <linux/highmem.h> #include <asm/unistd.h> MODULE_LICENSE("GPL"); // IOCTL commands #define IOCTL_PATCH_TABLE 0x00000001 #define IOCTL_FIX_TABLE

Memory region flags in Linux: why both VM_WRITE and VM_MAYWRITE are needed?

我只是一个虾纸丫 提交于 2020-02-25 06:22:06
问题 "Understanding the Linux Virtual Memory Manager" (2007) by Mel Gorman (here's a link to the book chapter) describes the flags of a memory region (vm_area_struct): VM_WRITE - Pages may be written VM_MAYWRITE - Allow the VM_WRITE flag to be set I don't understand why Linux needs these two flags, rather than just one of them. From the description above, it sounds like VM_MAYWRITE be set while VM_WRITE is not. In what situations? And how does the Linux kernel behave differently in these

Memory region flags in Linux: why both VM_WRITE and VM_MAYWRITE are needed?

点点圈 提交于 2020-02-25 06:22:05
问题 "Understanding the Linux Virtual Memory Manager" (2007) by Mel Gorman (here's a link to the book chapter) describes the flags of a memory region (vm_area_struct): VM_WRITE - Pages may be written VM_MAYWRITE - Allow the VM_WRITE flag to be set I don't understand why Linux needs these two flags, rather than just one of them. From the description above, it sounds like VM_MAYWRITE be set while VM_WRITE is not. In what situations? And how does the Linux kernel behave differently in these