Win10 Tensorflow-gpu 不完全安装手册

网上随便搜一下就会发现关于Tensorflow-gpu的安装文章非常的多,但是写的都比较简略。并且官网的文档写的也比较的简略,并且google 官网上文档对于windows版本的也非常简略。

官网列出的硬件软件需求如下:

硬件要求

系统支持以下支持 GPU 的设备:

软件要求

必须在系统中安装以下 NVIDIA® 软件:

除此之外就没有更多的信息了,在官方的pip安装说明页面中可以看到windows版本的其实对于python是有要求的,官方支持的版本如下:

Continue Reading

Django APScheduler + uwsgi 定时任务重复运行

基于某些原因可能在开发的时候通过django的manage.py运行定时任务没有任何的问题,但是一旦到了线上环境通过nginx+uwsgi来运行就会发现定时任务不断的重复执行,并且基本都执行失败了。发生这个问题的原因在于uwsgi启动了多个进程来提供服务,于是每次启动的时候定时任务都会跟着再启动一次,于是有4个进程的话,对应的服务就会启动4次,除了第一次可能执行成功后面的基本都会挂掉。

要解决这个问题其实也不难,只要保证在第一次启动的时候添加定时任务并且执行,以后启动的进程不再处理定时任务即可。但是在这种条件下通过python的进程互斥其实貌似并不是非常好使,具体可以看这个:

uWSGI employs some tricks which disable the Global Interpreter Lock and with it, the use of threads which are vital to the operation of APScheduler. To fix this, you need to re-enable the GIL using the --enable-threads switch. See the uWSGI documentation for more details.

Also, assuming that you will run more than one worker process (as you typically would in production), you should also read the next section.

https://apscheduler.readthedocs.io/en/latest/faq.html#how-can-i-use-apscheduler-with-uwsgi

Continue Reading