我正在尝试使用python抓取我的messenger.com(facebook Messenger)聊天,并且我已经使用Google chromes开发者工具查看聊天历史记录的POST请求,并且我已将整个标头和正文复制为请求可以使用的格式。
我得到的HTTP代码200暗示该请求至少有一些东西,但是我可以print res.encoding得到它返回的编码,其中说的是utf-8。但是我无法解码!
这是函数:
def download_thread(self, limit, offset, message_timestamp):
"""Download the specified number of messages from the
provided thread, with an optional offset
"""
data = request_data(self.thread, offset=offset,
limit=limit, group=self.group,
timestamp=message_timestamp)
res = self.ses.post(url_thread, data=data, headers=headers)
print(res.content)
thread_contents = json.loads(res.content)
print(thread_contents)
return thread_contents
Run Code Online (Sandbox Code Playgroud)
产量
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x87 in position 0: invalid start byte
Run Code Online (Sandbox Code Playgroud)
当它尝试json.load(或loads)数据时
但是res.encoding会返回utf-8。
我尝试用gzip解压缩,但是那不是gzip压缩的内容。
如果我只是试着做print(res.content)我得到
Traceback (most recent call last): …Run Code Online (Sandbox Code Playgroud) 我在 docker 容器上运行 Tensorflow 1.5.0,因为我需要使用不使用 AVX 字节码的版本,因为我运行的硬件太旧而无法支持它。
我终于正确导入了tensorflow-gpu(将docker映像降级到tf 1.5.0之后),但现在当我运行任何代码来检测GPU时,它说GPU不存在。
我查看了 docker 日志,Jupyter 吐出了这条消息
Ignoring visible gpu device (device: 0, name: GeForce GTX 760, pci bus id: 0000:01:00.0, compute capability: 3.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5.
Tensorflow网站说支持计算能力3.0的GPU,为什么说需要计算能力3.5呢?
有没有办法获得使用 tf 1.5.0 但支持具有计算能力的 GPU 的 TensorFlow 和 Jupyter 的 Docker 映像?