Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
vcadillog authored Nov 6, 2019
1 parent 2c94bba commit a4195c8
Showing 1 changed file with 251 additions and 0 deletions.
251 changes: 251 additions & 0 deletions EXAMPLE_OF_USE.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "FINAL_MODULAR_PPO.ipynb",
"provenance": [],
"collapsed_sections": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "code",
"metadata": {
"id": "tCbK3yr4BGrf",
"colab_type": "code",
"outputId": "273a1866-06ea-4f65-cc49-c785a0ccc9a9",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 394
}
},
"source": [
"!pip install gym-super-mario-bros"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Collecting gym-super-mario-bros\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/a0/b8/07460212c2568f78b02995834e7bdc25349e586473919e2983e01b984abf/gym_super_mario_bros-7.3.0-py2.py3-none-any.whl (198kB)\n",
"\u001b[K |████████████████████████████████| 204kB 3.4MB/s \n",
"\u001b[?25hCollecting nes-py>=8.0.0\n",
"\u001b[?25l Downloading https://files.pythonhosted.org/packages/00/98/f87eacc9ff3ddfe97ecc889165119317cd4782f5839c24b39f88a1a7e7d7/nes_py-8.1.1.tar.gz (74kB)\n",
"\u001b[K |████████████████████████████████| 81kB 8.5MB/s \n",
"\u001b[?25hRequirement already satisfied: gym>=0.10.9 in /usr/local/lib/python3.6/dist-packages (from nes-py>=8.0.0->gym-super-mario-bros) (0.15.3)\n",
"Requirement already satisfied: numpy>=1.12.1 in /usr/local/lib/python3.6/dist-packages (from nes-py>=8.0.0->gym-super-mario-bros) (1.17.3)\n",
"Requirement already satisfied: pyglet>=1.3.2 in /usr/local/lib/python3.6/dist-packages (from nes-py>=8.0.0->gym-super-mario-bros) (1.3.2)\n",
"Requirement already satisfied: tqdm>=4.19.5 in /usr/local/lib/python3.6/dist-packages (from nes-py>=8.0.0->gym-super-mario-bros) (4.28.1)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from gym>=0.10.9->nes-py>=8.0.0->gym-super-mario-bros) (1.12.0)\n",
"Requirement already satisfied: cloudpickle~=1.2.0 in /usr/local/lib/python3.6/dist-packages (from gym>=0.10.9->nes-py>=8.0.0->gym-super-mario-bros) (1.2.2)\n",
"Requirement already satisfied: scipy in /usr/local/lib/python3.6/dist-packages (from gym>=0.10.9->nes-py>=8.0.0->gym-super-mario-bros) (1.3.1)\n",
"Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from pyglet>=1.3.2->nes-py>=8.0.0->gym-super-mario-bros) (0.16.0)\n",
"Building wheels for collected packages: nes-py\n",
" Building wheel for nes-py (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for nes-py: filename=nes_py-8.1.1-cp36-cp36m-linux_x86_64.whl size=449197 sha256=cee50c0e2b12ec16e63c42303fd9decb2487e678a5dce92ea9be853b15f2f5cb\n",
" Stored in directory: /root/.cache/pip/wheels/04/d7/e4/0949e4c8947993c5555730a3b15f3cdc5a86507b95388dd608\n",
"Successfully built nes-py\n",
"Installing collected packages: nes-py, gym-super-mario-bros\n",
"Successfully installed gym-super-mario-bros-7.3.0 nes-py-8.1.1\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "A8sUWB7HSNmt",
"colab_type": "code",
"outputId": "37c37f5a-3f9f-4ec1-c374-010a57e32abb",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 119
}
},
"source": [
"!git clone https://github.com/vcadillog/PPO-Mario-Bros-Tensorflow-2.git"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"Cloning into 'PPO-Mario-Bros-Tensorflow-2'...\n",
"remote: Enumerating objects: 99, done.\u001b[K\n",
"remote: Counting objects: 100% (99/99), done.\u001b[K\n",
"remote: Compressing objects: 100% (97/97), done.\u001b[K\n",
"remote: Total 99 (delta 39), reused 0 (delta 0), pack-reused 0\u001b[K\n",
"Unpacking objects: 100% (99/99), done.\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "D9nw3jDxBT5x",
"colab_type": "code",
"colab": {}
},
"source": [
"try:\n",
" # %tensorflow_version solo existe in Colab.\n",
" %tensorflow_version 2.x\n",
"except Exception:\n",
" pass"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "tjbPcfmJgTMR",
"colab_type": "code",
"colab": {}
},
"source": [
"import os\n",
"os.chdir('./PPO-Mario-Bros-Tensorflow-2')"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "Mw6mjQ0whiZP",
"colab_type": "code",
"outputId": "9ee5dfef-69b1-4881-c9a9-bde0c33684ae",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
}
},
"source": [
"!python -c 'from Main import test; test(10,0)'"
],
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
"text": [
"2019-11-06 23:04:57.799844: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1\n",
"2019-11-06 23:04:57.862562: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:57.863493: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: \n",
"name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235\n",
"pciBusID: 0000:00:04.0\n",
"2019-11-06 23:04:57.872288: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0\n",
"2019-11-06 23:04:58.103152: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0\n",
"2019-11-06 23:04:58.193334: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10.0\n",
"2019-11-06 23:04:58.221193: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10.0\n",
"2019-11-06 23:04:58.484472: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10.0\n",
"2019-11-06 23:04:58.604998: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10.0\n",
"2019-11-06 23:04:59.084598: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n",
"2019-11-06 23:04:59.084906: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.085893: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.086641: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0\n",
"2019-11-06 23:04:59.087210: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\n",
"2019-11-06 23:04:59.122848: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2300000000 Hz\n",
"2019-11-06 23:04:59.123368: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x133ca00 executing computations on platform Host. Devices:\n",
"2019-11-06 23:04:59.123413: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version\n",
"2019-11-06 23:04:59.236126: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.237186: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x133cbc0 executing computations on platform CUDA. Devices:\n",
"2019-11-06 23:04:59.237252: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Tesla K80, Compute Capability 3.7\n",
"2019-11-06 23:04:59.238981: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.240007: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: \n",
"name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235\n",
"pciBusID: 0000:00:04.0\n",
"2019-11-06 23:04:59.240174: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0\n",
"2019-11-06 23:04:59.240252: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0\n",
"2019-11-06 23:04:59.240320: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10.0\n",
"2019-11-06 23:04:59.240390: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10.0\n",
"2019-11-06 23:04:59.240459: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10.0\n",
"2019-11-06 23:04:59.240510: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10.0\n",
"2019-11-06 23:04:59.240556: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n",
"2019-11-06 23:04:59.240752: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.241630: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.242451: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 0\n",
"2019-11-06 23:04:59.246631: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0\n",
"2019-11-06 23:04:59.248450: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:\n",
"2019-11-06 23:04:59.248505: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0 \n",
"2019-11-06 23:04:59.248530: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N \n",
"2019-11-06 23:04:59.249737: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.250806: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1006] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero\n",
"2019-11-06 23:04:59.251549: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
"2019-11-06 23:04:59.251628: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 10805 MB memory) -> physical GPU (device: 0, name: Tesla K80, pci bus id: 0000:00:04.0, compute capability: 3.7)\n",
"Load model policy_net\n",
"2019-11-06 23:05:03.917669: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10.0\n",
"2019-11-06 23:05:04.674845: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7\n",
"/usr/local/lib/python3.6/dist-packages/gym_super_mario_bros/smb_env.py:148: RuntimeWarning: overflow encountered in ubyte_scalars\n",
" return (self.ram[0x86] - self.ram[0x071c]) % 256\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #0 , Score: 158.3\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #1 , Score: 158.3\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #2 , Score: 158.3\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #3 , Score: 158.3\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #4 , Score: 158.3\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #5 , Score: 158.0\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #6 , Score: 158.3\n",
"OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'\n",
"OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'\n",
"Test #7 , Score: 158.4\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "u03EjGyyDkC6",
"colab_type": "code",
"colab": {}
},
"source": [
"%load_ext tensorboard"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "eTAx2Gw4AWyK",
"colab_type": "code",
"outputId": "8e332f58-ba02-44ae-9c06-98747a79d74b",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 817
}
},
"source": [
"%tensorboard --logdir logs"
],
"execution_count": 0,
"outputs": []
}
]
}

0 comments on commit a4195c8

Please sign in to comment.