x86 emulation currently requires hardware acceleration!

很久没有编译安卓的东西,创建了模拟器却发现启动不聊了。网上搜索了一下发现文章真是不少,但是里面说的东西下载地址却不是那个了。并且我安装了sdk之后也没有找到haxm-windows的安装程序。网上搜索了一下发现现在是个开源项目了。https://github.com/intel/haxm

HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor), widely used as an accelerator for Android Emulator and QEMU. It has always supported running on Windows and macOS, and has been ported to other host operating systems as well, such as Linux and NetBSD.

HAXM runs as a kernel-mode driver on the host operating system, and provides a KVM-like interface to user space, thereby enabling applications like QEMU to utilize the hardware virtualization capabilities built into modern Intel CPUs, namely Intel Virtualization Technology.

下载安装就ok了,如果没有开启vt首先要去bios里面开启vt。

 

Continue Reading

CUDNN_STATUS_NOT_INITIALIZED

自从装好tensorflow-gpu 之后其实一直没怎么用,今天跑代码的时候才发现安装的有问题:

测试代码如下:

from sklearn.datasets import load_sample_image
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
 
if __name__ == '__main__':
    # Load sample images
    china = load_sample_image("china.jpg")
    flower = load_sample_image("flower.jpg")
    dataset = np.array([china, flower], dtype=np.float32)
    batch_size, height, width, channels = dataset.shape
    # Create 2 filters
    filters = np.zeros(shape=(7, 7, channels, 2), dtype=np.float32)
    filters[:, 3, :, 0] = 1 # vertical line
    filters[3, :, :, 1] = 1 # horizontal line
    # Create a graph with input X plus a convolutional layer applying the 2 filters
    X = tf.placeholder(tf.float32, shape=(None, height, width, channels))
    convolution = tf.nn.conv2d(X, filters, strides=[1,2,2,1], padding="SAME")
    with tf.Session() as sess:
        output = sess.run(convolution, feed_dict={X: dataset})
    plt.imshow(output[0, :, :, 1], cmap="gray") # plot 1st image's 2nd feature map
    plt.show()
Continue Reading

由apscheduler引发的django.db.utils.InternalError: (1054, u”Unknown column ‘rms.go_datetime’ in ‘field list'”)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
apscheduler.scheduler:INFO 2019-03-01 10:22:53,849 Adding job tentatively -- it will be properly scheduled when the scheduler starts
apscheduler.scheduler:INFO 2019-03-01 10:22:53,849 Adding job tentatively -- it will be properly scheduled when the scheduler starts
Do first job!
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\urls\resolvers.py", line 407, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\urls\resolvers.py", line 400, in urlconf_module
return import_module(self.urlconf_name)
File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "F:\PyCharmProjects\B\B\B\urls.py", line 433, in <module>
import td.jobs # NOQA @isort:skip
File "F:\PyCharmProjects\B\B\td\jobs.py", line 174, in <module>
deal_with_first_jobs()
File "F:\PyCharmProjects\B\B\td\jobs.py", line 88, in deal_with_first_jobs
send_wechat_mini_app_push_message(rmds)
File "F:\PyCharmProjects\B\B\td\push.py", line 201, in send_wechat_mini_app_push_message
for rmd in rmds:
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\db\models\query.py", line 250, in __iter__
self._fetch_all()
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\db\models\query.py", line 1121, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\db\models\query.py", line 53, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "F:\PyCharmProjects\B\venv\lib\site-packages\django\db\models\sql\compiler.py", line 899, in execute_sql
raise original_exception
django.db.utils.InternalError: (1054, u"Unknown column 'rms.go_datetime' in 'field list'")

刚开始以为是代码写错了,后来发现并不是,出错的地方在jobs.py中所以其实并不是代码的问题,而是在jobs中为了能够在服务启动的时候发送上一次运行停止之后遗漏的任务导致的。所以如果使用了apscheduler可以尝试将jobs.py清空再次尝试。

Continue Reading

Synology(群辉) NAS Mariadb 配置文件修改

其实官方提供了一个配置文档,但是实际在修改的时候还是发现一些问题:

在管理 DSM 5.0 或更新版本中的数据库时,MariaDB 套件的默认设置应该能够满足大多数用户的要求。但如必要,您可手动更改 MariaDB 设置以满足您的特定需求。

请按以下说明完成操作:

  1. 如果没有名为 my.cnf 的配置文件,请创建该文件。该文件应包含您要在 MariaDB 中更改的设置(请参见以下实例)。
  2. 将 my.cnf 文件置于 Synology NAS 的以下路径:/var/packages/MariaDB/etc
  3. 重启 Synology NAS 或执行 /usr/syno/bin/synopkg restart MariaDB 来应用新设置。更新 MariaDB 套件或重启 DSM 后,新设置将被保留。

例如,要提高传入 MariaDB 的文件的大小上限,您可在 my.cnf 配置文件中添加以下命令行:

[mysqld]
max_allowed_packet = 1073741824

对于后续的版本或者系统更新, 这个文件并不在这个目录下,对于我目前实用的系统这个文件应该在如下目录下:

vim /var/packages/MariaDB10/etc/my.cnf

并且还有另外一个很鸡肋的问题,就是提供提供的命令/usr/syno/bin/synopkg restart MariaDB 貌似并没啥效果,不管是stop还是restart都是提示成功了,stop后提示成功了,但是依旧可以访问,并且配置信息并没有生效。

Continue Reading