2020.3.30-4.3问题记录

1. 问题:在docker build时出现

 

解决:

RUN DEBIAN_FRONTEND=noninteractivate apt-get install -y curl 

2. 问题:docker build时

 

 

 解决:

RUN apt-keyadv--keyserverkeyserver.ubuntu.comrecv-keys F60F4B3D7FA2AF80

 3. 快速生成requirement.txt的安装文件

pip freeze > requirements.txt

4. 问题:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

解决:使用any(), 或者 all(),判断其中

any([True False False])

表示只要有一个True 就返回 True,

all([True False False]) 

表示所有元素为True才会返回True, 否则返回False.

 

5. 问题:ValueError: assignment destination is read-only

解决:import numpy as np

frame.flags.writeable = True

 

6. 问题:

frame.flags.writeable = True
ValueError: cannot set WRITEABLE flag to True of this array

解决:在img基础上,重新构造个数组 img = np.array(frame) ,再frame.flags.writeable = True即可。

posted @ 2020-04-08 16:50  Revolutiom  阅读(165)  评论(0)    收藏  举报