UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[node sequential/conv2d/Conv2D (defined at C:\path_of_envs\lib\site-packages\tensorflow_core\python\framework\ops.py:1751) ]] [Op:__inference_distributed_function_985]Function call stack:distributed_function
By default, TensorFlow maps nearly all of the GPU memory of all GPUs (subject to CUDA_VISIBLE_DEVICES) visible to the process. This is done to more efficiently use the relatively precious GPU memory resources on the devices by reducing memory fragmentation. …… In some cases it is desirable for the process to only allocate a subset of the available memory, or to only grow the memory usage as is needed by the process. TensorFlow provides two methods to control this.
The first option is to turn on memory growth by calling tf.config.experimental.set_memory_growth, which attempts to allocate only as much GPU memory as needed for the runtime allocations ……
gpus = tf.config.experimental.list_physical_devices('GPU') try: for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True) except RuntimeError as ex: print(ex)
If you install 5.7 and don’t provide a password to the root user, it will use the auth_socket plugin. That plugin doesn’t care and doesn’t need a password. It just checks if the user is connecting using a UNIX socket and then compares the username.2
@raspberrypi:~ $ pip3 Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main' from 'pip' (/home/pi/.local/lib/python3.7/site-packages/pip/__init__.py)
var hq_str_sh600030="中信证券,20.080,20.080,21.090,21.160,20.040,21.090,21.100,221743961,4597038936.000,851863,21.090,322800,21.080,435235,21.070,342211,21.060,289618,21.050,777017,21.100,325000,21.110,255800,21.120,241600,21.130,248400,21.140,2019-06-11,15:00:00,00";
各个返回的参数说明如下:
序号
示例
说明
0
中信证券
股票(指数)名称
1
20.080
今日开盘
2
20.080
昨日收盘
3
21.090
最新价格
4
21.160
今日最高
5
20.040
今日最低
6
21.090
竞买价,即“买一”报价
7
21.100
竞卖价,即“卖一”报价
8
221743961
成交量
9
4597038936.000
成交额
10
851863
“买一”报价股数,即约 8519 手
11
21.090
“买一”报价
12-19
……
“买二”至“买五”报价
20-29
……
“卖一”至“卖五”报价
30
2019-06-11
日期
31
15:00:00
时间
32
00
好像收盘后会出现这个标签
虽然里面没有涨跌幅数据,但是可以通过当前价格与昨日收盘计算得到。
多个查询
上述接口也可一次性请求多个股票代码:
1
http://hq.sinajs.cn/list=sh000001,sz399001
返回数据如下:
1 2
var hq_str_sh000001="上证指数,2854.0704,2852.1302,2905.4450,2907.5344,2854.0704,0,0,145152763,141817520795,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2019-06-11,11:35:03,00"; var hq_str_sz399001="深证成指,8721.272,8711.786,8964.885,8970.501,8718.472,0.000,0.000,18135395376,177191151062.308,0,0.000,0,0.000,0,0.000,0,0.000,0,0.000,0,0.000,0,0.000,0,0.000,0,0.000,0,0.000,2019-06-11,11:35:03,00";
港股
HTTP 请求方式:GET
1
http://hq.sinajs.cn/list=hk<SYMBOL>
SYMBOL 为股票代码。如 HSI 为恒生指数,00728 为中国电信:
1
http://hq.sinajs.cn/list=hkHSI,hk00728
美股
HTTP 请求方式:GET
1
http://hq.sinajs.cn/list=gb_<SYMBOL>
请求参数说明
SYMBOL 为股票代码。如:ixic 为纳斯达克综合指数,dji,为道琼斯工业指数。
返回说明
以 BILI 哔哩哔哩为例,请求 URL 如下:
1
http://hq.sinajs.cn/list=gb_bili
正常情况下,服务器会返回以下信息:
1
var hq_str_gb_bili="哔哩哔哩,15.0600,1.76,2019-06-11 09:31:51,0.2600,14.9100,15.3100,14.8800,22.7000,9.0900,3584557,3849047,4698720000,-0.34,--,0.00,0.00,0.00,0.00,312000000,0.00,15.1100,0.33,0.05,Jun 10 08:00PM EDT,Jun 10 04:00PM EDT,14.8000,20455.00";
PS C:\Andromeda\Homestead> vagrant up Bringing machine 'homestead-7' up with 'virtualbox' provider... ==> homestead-7: Checking if box 'andromeda/homestead' is up to date... ==> homestead-7: Clearing any previously set forwarded ports... ==> homestead-7: Clearing any previously set network interfaces... ==> homestead-7: Preparing network interfaces based on configuration... homestead-7: Adapter 1: nat homestead-7: Adapter 2: hostonly ==> homestead-7: Forwarding ports... homestead-7: 80 (guest) => 8000 (host) (adapter 1) homestead-7: 443 (guest) => 44300 (host) (adapter 1) homestead-7: 3306 (guest) => 33060 (host) (adapter 1) homestead-7: 4040 (guest) => 4040 (host) (adapter 1) homestead-7: 5432 (guest) => 54320 (host) (adapter 1) homestead-7: 8025 (guest) => 8025 (host) (adapter 1) homestead-7: 27017 (guest) => 27017 (host) (adapter 1) homestead-7: 22 (guest) => 2333 (host) (adapter 1) ==> homestead-7: Running 'pre-boot' VM customizations... ==> homestead-7: Booting VM... ==> homestead-7: Waiting for machine to boot. This may take a few minutes... homestead-7: SSH address: 127.0.0.1:2333 homestead-7: SSH username: vagrant homestead-7: SSH auth method: private key ...
等待数分钟之后,提示 Timed out:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Timed out while waiting for the machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that Vagrant had when attempting to connect to the machine. These errors are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly working and you're able to connect to the machine. It is a common problem that networking isn't setup properly in these boxes. Verify that authentication configurations are also setup properly, as well.
If the box appears to be booting properly, you may want to increase the timeout ("config.vm.boot_timeout") value.