- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在关注this tutorial使用谷歌Colab。但我在运行应启用 Doom 环境的 from vizdoom import *
时遇到问题。我尝试执行!pip install vizdoom
,但失败了。
Collecting vizdoom
Using cached https://files.pythonhosted.org/packages/45/15/8053139ab32054bed0b1bf46473f54c5a8d85e5c1d25b23410bc5de913c1/vizdoom-1.1.4.tar.gz
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from vizdoom) (1.14.3)
Building wheels for collected packages: vizdoom
Running setup.py bdist_wheel for vizdoom ... error
Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-GsCBh9/vizdoom/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-tsUxvp --python-tag cp27:
running bdist_wheel
running build
error: [Errno 2] No such file or directory
----------------------------------------
Failed building wheel for vizdoom
Running setup.py clean for vizdoom
Failed to build vizdoom
Installing collected packages: vizdoom
Running setup.py install for vizdoom ... error
Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-GsCBh9/vizdoom/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-N3TTEU/install-record.txt --single-version-externally-managed --compile:
running install
running build
error: [Errno 2] No such file or directory
----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-GsCBh9/vizdoom/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-N3TTEU/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-GsCBh9/vizdoom/
该指令表明“您需要下载 vizdoom 并将该文件夹放入存储库中”。但我不清楚如何在 Google Colab 中做到这一点。非常感谢任何帮助。
最佳答案
您首先需要安装适用于 Linux 的 vizdoom deps。它们列在此页面上: https://github.com/mwydmuch/ViZDoom/blob/master/doc/Building.md#-linux
%%bash
# Install deps from
# https://github.com/mwydmuch/ViZDoom/blob/master/doc/Building.md#-linux
apt-get install build-essential zlib1g-dev libsdl2-dev libjpeg-dev \
nasm tar libbz2-dev libgtk2.0-dev cmake git libfluidsynth-dev libgme-dev \
libopenal-dev timidity libwildmidi-dev unzip
# Boost libraries
apt-get install libboost-all-dev
# Lua binding dependencies
apt-get install liblua5.1-dev
安装这些后,我能够成功导入所有库:
import tensorflow as tf # Deep Learning library
import numpy as np # Handle matrices
from vizdoom import * # Doom Environment
import random # Handling random number generation
import time # Handling time calculation
from skimage import transform# Help us to preprocess the frames
from collections import deque# Ordered collection with ends
import matplotlib.pyplot as plt # Display graphs
这是一个完整的示例笔记本:<强> https://colab.research.google.com/drive/1zDRkLhgjfOzW9C8jCtQ7-99TPDhxpCev
安装大约需要 10 分钟。您可能需要考虑将 Colab 与 a local Jupyter runtime 一起使用这样您就可以在后续调用笔记本时跳过设置开销。
关于python - 如何使用 Google Colab 安装 vizdoom?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50667565/
例如从 Keras 导入 CIFAR-10 时(使用 from keras.datasets import cifar10 (x_train, y_train), (x_test, y_test) =
我在 gmail 上有两个帐户,并且都同时打开:Account_1@gmail.com 和 Account_2@gmail.com 当我打开 https://colab.research.google
我们可以以任何方式在 google colab 中为 Markdown 单元格启用拼写检查器吗?请帮忙。 最佳答案 我不知道直接在 Google Colaboratory 中执行此操作的任何方法,但是
似乎有很多方法可以从 Colab 访问 Google Drive 上的文件,但没有简单的方法可以将文件从 Google Colab 保存回 Google Drive。 例如,要从 Colab 访问 G
在 Google CoLab 左侧是一个可以打开的 Pane ,显示 Table of Contents , Code snippets , 和 Files . 在 Files Pane 中有一个上传
[较新的编辑]:colab 团队报告说他们已于 2020 年 5 月 27 日更正了该问题。 我已经检查过了 - 现在对我来说可以了。 问题链接:https://github.com/googleco
我一直在尝试读取 google colab 中的文件,它应该将文件作为简单的 JSON 读取,但我什至不能在没有得到 100 个的情况下执行 json.dumps(file)错误 上传文件: impo
training_dataset_file = open('C:/Users/kbg04289/Desktop/mnist_train.csv', 'r') 我尝试了几种方法 比如'用\'制作地址并检
我在 colab 单元中有以下代码: import sklearn.datasets import pandas as pd import numpy as np from sklearn.model
最后我正在研究谷歌合作实验室 我收到了这个数据集celeba,它进入了google驱动器帐户,并且该帐户不是我的帐户,但是我可以访问它 现在,由于互联网问题和驱动器容量,我无法卸载数据集,然后将其上传
德国的大家下午好! Google Colab 和我似乎对什么是可能的、什么是不可能的看法存在分歧......我只是想要一种从单元格内访问所有其他单元格的内容的方法。 我的用例是,我想将当前 Colab
很高兴我可以在 CoLab 中运行 jupyter 笔记本,但我正在疯狂地保存和加载文件。例如,我正在为我的类(class)编写作业,并使用 HTML 标签在其中包含图形。 (我想使用 HTML 而不
我正在使用\begin{equation}.. \end{equation}在 Colab 笔记本中的 Markdown 模式下,我没有像我期望的那样从 Latex 获得方程式编号。 有没有办法解决这
有谁知道是否有办法制作图表,使轴值在 Colab 中悬停时显示? 我找到了几个类似的答案 import matplotlib.pylab as plt import numpy as np f,a =
我写了一个 Langton 的 Ant 代码,我想让动画在 Colab 中运行,直到它被用户停止或在一定数量的帧之后。就像现在一样,它先生成所有的帧,然后将它们编译成动画然后显示。如果有很多帧,则需要
在过去的几个月里,我一直在使用 Google Colab,在连接到驱动器和使用 ! 键入 shell 命令时没有出现任何问题。然而今天突然出现错误,我找不到任何解决方法。 Colab 似乎无法在目录中
我开始使用 google colab 我想从我的笔记本电脑加载一组图像进行处理。 我试过这个: 但是我得到了错误: TypeError: embedded NUL character 那么导入图像的正
即使我将我的 Google 云端硬盘(以及其中的数据集)定义为 google colab,但是当我运行我的代码时,我给出了这个错误:FileNotFoundError: [Errno 2] No su
前言。我正在尝试使用 Google Colab 来教学生 Python。问题是,没有很好的工具来可视化代码执行。我尝试通过将 Python Tutor 与 Google Colab 集成来使用它,即创
我已将多个文件夹从云端硬盘导入到 Google Colab。较小的文件夹在列出目录时工作正常,但当我尝试列出较大文件夹中的目录时,Colab 给我一个错误。 我知道还有其他列出目录的方法,但当我尝试访
我是一名优秀的程序员,十分优秀!