Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 22.70 KB | None | 0 0
  1.  
  2. R version 3.5.1 (2018-07-02) -- "Feather Spray"
  3. Copyright (C) 2018 The R Foundation for Statistical Computing
  4. Platform: x86_64-w64-mingw32/x64 (64-bit)
  5.  
  6. R is free software and comes with ABSOLUTELY NO WARRANTY.
  7. You are welcome to redistribute it under certain conditions.
  8. Type 'license()' or 'licence()' for distribution details.
  9.  
  10. R is a collaborative project with many contributors.
  11. Type 'contributors()' for more information and
  12. 'citation()' on how to cite R or R packages in publications.
  13.  
  14. Type 'demo()' for some demos, 'help()' for on-line help, or
  15. 'help.start()' for an HTML browser interface to help.
  16. Type 'q()' to quit R.
  17.  
  18. > install.packages("keras")
  19. Installing package into ‘D:/Program Files/Dokumenty/R/win-library/3.5
  20. (as ‘lib’ is unspecified)
  21. also installing the dependencies ‘ps’, ‘glue’, ‘purrr’, ‘jsonlite’, ‘Rcpp’, ‘config’, ‘processx’, ‘yaml’, ‘rstudioapi’, ‘base64enc’, ‘whisker’, ‘tidyselect’, ‘rlang’, ‘generics’, ‘reticulate’, ‘tensorflow’, ‘tfruns’, ‘magrittr’, ‘zeallot’, ‘R6’
  22.  
  23.  
  24.   There is a binary version available but the source
  25.   version is later:
  26.       binary source needs_compilation
  27. purrr  0.3.2  0.3.3              TRUE
  28.  
  29.   Binaries will be installed
  30. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/ps_1.3.0.zip'
  31. Content type 'application/zip' length 304406 bytes (297 KB)
  32. downloaded 297 KB
  33.  
  34. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/glue_1.3.1.zip'
  35. Content type 'application/zip' length 172536 bytes (168 KB)
  36. downloaded 168 KB
  37.  
  38. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/purrr_0.3.2.zip'
  39. Content type 'application/zip' length 417465 bytes (407 KB)
  40. downloaded 407 KB
  41.  
  42. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/jsonlite_1.6.zip'
  43. Content type 'application/zip' length 1160780 bytes (1.1 MB)
  44. downloaded 1.1 MB
  45.  
  46. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/Rcpp_1.0.2.zip'
  47. Content type 'application/zip' length 4550765 bytes (4.3 MB)
  48. downloaded 4.3 MB
  49.  
  50. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/config_0.3.zip'
  51. Content type 'application/zip' length 27186 bytes (26 KB)
  52. downloaded 26 KB
  53.  
  54. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/processx_3.4.1.zip'
  55. Content type 'application/zip' length 407287 bytes (397 KB)
  56. downloaded 397 KB
  57.  
  58. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/yaml_2.2.0.zip'
  59. Content type 'application/zip' length 203571 bytes (198 KB)
  60. downloaded 198 KB
  61.  
  62. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rstudioapi_0.10.zip'
  63. Content type 'application/zip' length 236601 bytes (231 KB)
  64. downloaded 231 KB
  65.  
  66. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/base64enc_0.1-3.zip'
  67. Content type 'application/zip' length 43316 bytes (42 KB)
  68. downloaded 42 KB
  69.  
  70. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/whisker_0.4.zip'
  71. Content type 'application/zip' length 82786 bytes (80 KB)
  72. downloaded 80 KB
  73.  
  74. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tidyselect_0.2.5.zip'
  75. Content type 'application/zip' length 625646 bytes (610 KB)
  76. downloaded 610 KB
  77.  
  78. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.4.0.zip'
  79. Content type 'application/zip' length 1076800 bytes (1.0 MB)
  80. downloaded 1.0 MB
  81.  
  82. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/generics_0.0.2.zip'
  83. Content type 'application/zip' length 64258 bytes (62 KB)
  84. downloaded 62 KB
  85.  
  86. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/reticulate_1.13.zip'
  87. Content type 'application/zip' length 1632939 bytes (1.6 MB)
  88. downloaded 1.6 MB
  89.  
  90. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tensorflow_2.0.0.zip'
  91. Content type 'application/zip' length 151913 bytes (148 KB)
  92. downloaded 148 KB
  93.  
  94. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tfruns_1.4.zip'
  95. Content type 'application/zip' length 1478786 bytes (1.4 MB)
  96. downloaded 1.4 MB
  97.  
  98. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/magrittr_1.5.zip'
  99. Content type 'application/zip' length 155654 bytes (152 KB)
  100. downloaded 152 KB
  101.  
  102. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/zeallot_0.1.0.zip'
  103. Content type 'application/zip' length 61450 bytes (60 KB)
  104. downloaded 60 KB
  105.  
  106. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/R6_2.4.0.zip'
  107. Content type 'application/zip' length 58359 bytes (56 KB)
  108. downloaded 56 KB
  109.  
  110. trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/keras_2.2.5.0.zip'
  111. Content type 'application/zip' length 3926715 bytes (3.7 MB)
  112. downloaded 3.7 MB
  113.  
  114. package ‘ps’ successfully unpacked and MD5 sums checked
  115. package ‘glue’ successfully unpacked and MD5 sums checked
  116. package ‘purrr’ successfully unpacked and MD5 sums checked
  117. package ‘jsonlite’ successfully unpacked and MD5 sums checked
  118. package ‘Rcpp’ successfully unpacked and MD5 sums checked
  119. package ‘config’ successfully unpacked and MD5 sums checked
  120. package ‘processx’ successfully unpacked and MD5 sums checked
  121. package ‘yaml’ successfully unpacked and MD5 sums checked
  122. package ‘rstudioapi’ successfully unpacked and MD5 sums checked
  123. package ‘base64enc’ successfully unpacked and MD5 sums checked
  124. package ‘whisker’ successfully unpacked and MD5 sums checked
  125. package ‘tidyselect’ successfully unpacked and MD5 sums checked
  126. package ‘rlang’ successfully unpacked and MD5 sums checked
  127. package ‘generics’ successfully unpacked and MD5 sums checked
  128. package ‘reticulate’ successfully unpacked and MD5 sums checked
  129. package ‘tensorflow’ successfully unpacked and MD5 sums checked
  130. package ‘tfruns’ successfully unpacked and MD5 sums checked
  131. package ‘magrittr’ successfully unpacked and MD5 sums checked
  132. package ‘zeallot’ successfully unpacked and MD5 sums checked
  133. package ‘R6’ successfully unpacked and MD5 sums checked
  134. package ‘keras’ successfully unpacked and MD5 sums checked
  135.  
  136. The downloaded binary packages are in
  137.     C:\Users\Student\AppData\Local\Temp\RtmpYtHPQj\downloaded_packages
  138. > library(keras)
  139. Warning message:
  140. pakiet ‘keras’ został zbudowany w wersji R 3.5.3
  141. > mnist <- dataset_mnist()
  142. Error in initialize_python(required_module, use_environment) :
  143.   Installation of Python not found, Python bindings not loaded.
  144. > mnist <- dataset_mnist()
  145. Error in initialize_python(required_module, use_environment) :
  146.   Installation of Python not found, Python bindings not loaded.
  147. > mnist <- dataset_mnist()
  148. Error in initialize_python(required_module, use_environment) :
  149.   Installation of Python not found, Python bindings not loaded.
  150. > install_keras()
  151. Error: Keras installation failed (no conda binary found)
  152.  
  153. Install Anaconda for Python 3.x (https://www.anaconda.com/download/#windows)
  154. before installing Keras.
  155. > mnist <- dataset_mnist()
  156. Error in initialize_python(required_module, use_environment) :
  157.   Installation of Python not found, Python bindings not loaded.
  158. > install_keras()
  159. Error: Keras installation failed (no conda binary found)
  160.  
  161. Install Anaconda for Python 3.x (https://www.anaconda.com/download/#windows)
  162. before installing Keras.
  163. > install_keras()
  164. Collecting package metadata (current_repodata.json): ...working... done
  165. Solving environment: ...working... done
  166.  
  167. ## Package Plan ##
  168.  
  169.   environment location: C:\Users\Student\ANACON~1\envs\r-reticulate
  170.  
  171.   added / updated specs:
  172.     - python=3.6
  173.  
  174.  
  175. The following packages will be downloaded:
  176.  
  177.     package                    |            build
  178.     ---------------------------|-----------------
  179.     certifi-2019.9.11          |           py36_0         155 KB
  180.     pip-19.2.3                 |           py36_0         1.9 MB
  181.     python-3.6.9               |       h5500b2f_0        15.9 MB
  182.     setuptools-41.4.0          |           py36_0         679 KB
  183.     wheel-0.33.6               |           py36_0          58 KB
  184.     wincertstore-0.2           |   py36h7fe50ca_0          14 KB
  185.     ------------------------------------------------------------
  186.                                            Total:        18.7 MB
  187.  
  188. The following NEW packages will be INSTALLED:
  189.  
  190.   certifi            pkgs/main/win-64::certifi-2019.9.11-py36_0
  191.   pip                pkgs/main/win-64::pip-19.2.3-py36_0
  192.   python             pkgs/main/win-64::python-3.6.9-h5500b2f_0
  193.   setuptools         pkgs/main/win-64::setuptools-41.4.0-py36_0
  194.   sqlite             pkgs/main/win-64::sqlite-3.30.0-he774522_0
  195.   vc                 pkgs/main/win-64::vc-14.1-h0510ff6_4
  196.   vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_0
  197.   wheel              pkgs/main/win-64::wheel-0.33.6-py36_0
  198.   wincertstore       pkgs/main/win-64::wincertstore-0.2-py36h7fe50ca_0
  199.  
  200.  
  201.  
  202. Downloading and Extracting Packages
  203. pip-19.2.3           | 1.9 MB    | ########## | 100%
  204. wincertstore-0.2     | 14 KB     | ########## | 100%
  205. wheel-0.33.6         | 58 KB     | ########## | 100%
  206. python-3.6.9         | 15.9 MB   | ########## | 100%
  207. certifi-2019.9.11    | 155 KB    | ########## | 100%
  208. setuptools-41.4.0    | 679 KB    | ########## | 100%
  209. Preparing transaction: ...working... done
  210. Verifying transaction: ...working... done
  211. Executing transaction: ...working... done
  212. #
  213. # To activate this environment, use
  214. #
  215. #     $ conda activate r-reticulate
  216. #
  217. # To deactivate an active environment, use
  218. #
  219. #     $ conda deactivate
  220.  
  221.  
  222. D:\Program Files\Dokumenty>conda.bat activate r-reticulate
  223. Collecting tensorflow==2.0.0
  224.   Downloading https://files.pythonhosted.org/packages/d3/af/296748d4c8d8987423231b93aecce5ab5952f6f2243cb6cedb88dd425397/tensorflow-2.0.0-cp36-cp36m-win_amd64.whl (48.1MB)
  225. Collecting keras
  226.   Downloading https://files.pythonhosted.org/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl (377kB)
  227. Collecting tensorflow-hub
  228.   Downloading https://files.pythonhosted.org/packages/ac/64/3bba86ca49ef21a4add11a4d37e3f6cd05d2e61d207ebe26a8a96b340826/tensorflow_hub-0.6.0-py2.py3-none-any.whl (84kB)
  229. Collecting h5py
  230.   Downloading https://files.pythonhosted.org/packages/0b/fa/bee65d2dbdbd3611702aafd128139c53c90a1285f169ba5467aab252e27a/h5py-2.10.0-cp36-cp36m-win_amd64.whl (2.4MB)
  231. Collecting pyyaml
  232.   Downloading https://files.pythonhosted.org/packages/76/da/60f8d638d81d64db4ed3c279c22eb3a1eebfcde6130fee678940e603b930/PyYAML-5.1.2-cp36-cp36m-win_amd64.whl (214kB)
  233. Collecting requests
  234.   Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
  235. Collecting Pillow
  236.   Downloading https://files.pythonhosted.org/packages/b7/37/294a6ef8506cfebf8925c22d507fab7ea10e8279c915653571472ee903e1/Pillow-6.2.0-cp36-cp36m-win_amd64.whl (2.0MB)
  237. Collecting scipy
  238.   Downloading https://files.pythonhosted.org/packages/e1/63/d919e16c5bd3502a0f7675f217625bd6f49a412cc1a856aa6b4b5b5b20bc/scipy-1.3.1-cp36-cp36m-win_amd64.whl (30.5MB)
  239. Collecting absl-py>=0.7.0 (from tensorflow==2.0.0)
  240.   Downloading https://files.pythonhosted.org/packages/3b/72/e6e483e2db953c11efa44ee21c5fdb6505c4dffa447b4263ca8af6676b62/absl-py-0.8.1.tar.gz (103kB)
  241. Collecting protobuf>=3.6.1 (from tensorflow==2.0.0)
  242.   Downloading https://files.pythonhosted.org/packages/2d/73/4a14606fa26f186e23015bc974f9010e2bbf1607f372e3bd5e82d2a62f1b/protobuf-3.10.0-cp36-cp36m-win_amd64.whl (1.1MB)
  243. Collecting tensorboard<2.1.0,>=2.0.0 (from tensorflow==2.0.0)
  244.   Downloading https://files.pythonhosted.org/packages/9b/a6/e8ffa4e2ddb216449d34cfcb825ebb38206bee5c4553d69e7bc8bc2c5d64/tensorboard-2.0.0-py3-none-any.whl (3.8MB)
  245. Collecting wrapt>=1.11.1 (from tensorflow==2.0.0)
  246.   Downloading https://files.pythonhosted.org/packages/23/84/323c2415280bc4fc880ac5050dddfb3c8062c2552b34c2e512eb4aa68f79/wrapt-1.11.2.tar.gz
  247. Collecting astor>=0.6.0 (from tensorflow==2.0.0)
  248.   Downloading https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
  249. Collecting keras-preprocessing>=1.0.5 (from tensorflow==2.0.0)
  250.   Downloading https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41kB)
  251. Collecting tensorflow-estimator<2.1.0,>=2.0.0 (from tensorflow==2.0.0)
  252.   Downloading https://files.pythonhosted.org/packages/fc/08/8b927337b7019c374719145d1dceba21a8bb909b93b1ad6f8fb7d22c1ca1/tensorflow_estimator-2.0.1-py2.py3-none-any.whl (449kB)
  253. Collecting termcolor>=1.1.0 (from tensorflow==2.0.0)
  254.   Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
  255. Requirement already satisfied, skipping upgrade: wheel>=0.26 in c:\users\student\anacon~1\envs\r-reticulate\lib\site-packages (from tensorflow==2.0.0) (0.33.6)
  256. Collecting keras-applications>=1.0.8 (from tensorflow==2.0.0)
  257.   Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
  258. Collecting opt-einsum>=2.3.2 (from tensorflow==2.0.0)
  259.   Downloading https://files.pythonhosted.org/packages/b8/83/755bd5324777875e9dff19c2e59daec837d0378c09196634524a3d7269ac/opt_einsum-3.1.0.tar.gz (69kB)
  260. Collecting numpy<2.0,>=1.16.0 (from tensorflow==2.0.0)
  261.   Downloading https://files.pythonhosted.org/packages/55/7a/f32b39164262765b069b0fe3ec5d4b47580c9c60f7bd3588b58ba8e93a4c/numpy-1.17.3-cp36-cp36m-win_amd64.whl (12.7MB)
  262. Collecting gast==0.2.2 (from tensorflow==2.0.0)
  263.   Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
  264. Collecting grpcio>=1.8.6 (from tensorflow==2.0.0)
  265.   Downloading https://files.pythonhosted.org/packages/4b/75/35bb3a14f671c34ecda9d621b5f363b02011baf67c4c0c6ce6b9e9aa4ddc/grpcio-1.24.1-cp36-cp36m-win_amd64.whl (1.8MB)
  266. Collecting google-pasta>=0.1.6 (from tensorflow==2.0.0)
  267.   Downloading https://files.pythonhosted.org/packages/d0/33/376510eb8d6246f3c30545f416b2263eee461e40940c2a4413c711bdf62d/google_pasta-0.1.7-py3-none-any.whl (52kB)
  268. Collecting six>=1.10.0 (from tensorflow==2.0.0)
  269.   Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
  270. Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in c:\users\student\anacon~1\envs\r-reticulate\lib\site-packages (from requests) (2019.9.11)
  271. Collecting chardet<3.1.0,>=3.0.2 (from requests)
  272.   Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
  273. Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
  274.   Downloading https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl (125kB)
  275. Collecting idna<2.9,>=2.5 (from requests)
  276.   Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
  277. Requirement already satisfied, skipping upgrade: setuptools in c:\users\student\anacon~1\envs\r-reticulate\lib\site-packages (from protobuf>=3.6.1->tensorflow==2.0.0) (41.4.0)
  278. Collecting markdown>=2.6.8 (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0.0)
  279.   Downloading https://files.pythonhosted.org/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl (87kB)
  280. Collecting werkzeug>=0.11.15 (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0.0)
  281.   Downloading https://files.pythonhosted.org/packages/ce/42/3aeda98f96e85fd26180534d36570e4d18108d62ae36f87694b476b83d6f/Werkzeug-0.16.0-py2.py3-none-any.whl (327kB)
  282. Building wheels for collected packages: absl-py, wrapt, termcolor, opt-einsum, gast
  283.   Building wheel for absl-py (setup.py): started
  284.   Building wheel for absl-py (setup.py): finished with status 'done'
  285.   Created wheel for absl-py: filename=absl_py-0.8.1-cp36-none-any.whl size=121171 sha256=2df1b317a9981d261a884ac374bffb447951f5595726b4f0613d475bc4151030
  286.   Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\a7\15\a0\0a0561549ad11cdc1bc8fa1191a353efd30facf6bfb507aefc
  287.   Building wheel for wrapt (setup.py): started
  288.   Building wheel for wrapt (setup.py): finished with status 'done'
  289.   Created wheel for wrapt: filename=wrapt-1.11.2-cp36-none-any.whl size=19597 sha256=575c364e8598c44a137178d3c60aa61f1bcee35186f2bd02202f51985de9e929
  290.   Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\d7\de\2e\efa132238792efb6459a96e85916ef8597fcb3d2ae51590dfd
  291.   Building wheel for termcolor (setup.py): started
  292.   Building wheel for termcolor (setup.py): finished with status 'done'
  293.   Created wheel for termcolor: filename=termcolor-1.1.0-cp36-none-any.whl size=4835 sha256=affac11ea9b77cd00d04da7375506e31f9f9abf972f1eeb21323129dc671c60b
  294.   Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\7c\06\54\bc84598ba1daf8f970247f550b175aaaee85f68b4b0c5ab2c6
  295.   Building wheel for opt-einsum (setup.py): started
  296.   Building wheel for opt-einsum (setup.py): finished with status 'done'
  297.   Created wheel for opt-einsum: filename=opt_einsum-3.1.0-cp36-none-any.whl size=61701 sha256=a03c5086d0380e6c472d8595102e7b84bb8ca73eb0666561af0e89e0b1bb465b
  298.   Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\2c\b1\94\43d03e130b929aae7ba3f8d15cbd7bc0d1cb5bb38a5c721833
  299.   Building wheel for gast (setup.py): started
  300.   Building wheel for gast (setup.py): finished with status 'done'
  301.   Created wheel for gast: filename=gast-0.2.2-cp36-none-any.whl size=7547 sha256=674f47039570467ac25b889000c71159e23a8bc706099e48594a03b11c63ace5
  302.   Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\5c\2e\7e\a1d4d4fcebe6c381f378ce7743a3ced3699feb89bcfbdadadd
  303. Successfully built absl-py wrapt termcolor opt-einsum gast
  304. Installing collected packages: six, absl-py, protobuf, markdown, werkzeug, numpy, grpcio, tensorboard, wrapt, astor, keras-preprocessing, tensorflow-estimator, termcolor, h5py, keras-applications, opt-einsum, gast, google-pasta, tensorflow, pyyaml, scipy, keras, tensorflow-hub, chardet, urllib3, idna, requests, Pillow
  305. Successfully installed Pillow-6.2.0 absl-py-0.8.1 astor-0.8.0 chardet-3.0.4 gast-0.2.2 google-pasta-0.1.7 grpcio-1.24.1 h5py-2.10.0 idna-2.8 keras-2.3.1 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 numpy-1.17.3 opt-einsum-3.1.0 protobuf-3.10.0 pyyaml-5.1.2 requests-2.22.0 scipy-1.3.1 six-1.12.0 tensorboard-2.0.0 tensorflow-2.0.0 tensorflow-estimator-2.0.1 tensorflow-hub-0.6.0 termcolor-1.1.0 urllib3-1.25.6 werkzeug-0.16.0 wrapt-1.11.2
  306.  
  307. Installation complete.
  308.  
  309. > library(keras)
  310. >
  311. > mnist <- dataset_mnist()
  312.  
  313. Restarting R session...
  314.  
  315. >
  316. > train_images <- mnist$train$x
  317. Error: object 'mnist' not found
  318. > mnist <- dataset_mnist()
  319. Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
  320. 11493376/11490434 [==============================] - 5s 0us/step
  321. > train_images <- mnist$train$x
  322. > train_labels <- mnist$train$y
  323. > test_images <- mnist$test$x
  324. > test_images <- mnist$test$y
  325. > ````
  326. Error: attempt to use zero-length variable name
  327. > str(train_images)
  328.  int [1:60000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
  329. > str(train_labels)
  330.  int [1:60000(1d)] 5 0 4 1 9 2 1 3 1 4 ...
  331. > str(test_images)
  332.  int [1:10000(1d)] 7 2 1 0 4 1 4 9 5 9 ...
  333. > str(test_labels)
  334. Error in str(test_labels) : object 'test_labels' not found
  335. > test_images <- mnist$test$x
  336. > test_labels <- mnist$test$y
  337. > str(test_images)
  338.  int [1:10000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
  339. > str(test_labels)
  340.  int [1:10000(1d)] 7 2 1 0 4 1 4 9 5 9 ...
  341. > network <- keras_model_sequential() %>%
  342. +
  343. + network <- keras_model_sequential()
  344. Error in keras_model_sequential() %>% network <- keras_model_sequential() :
  345.   invalid (NULL) left side of assignment
  346. > network <- keras_model_sequential()
  347. > layer_dense(units=512, activation ="relu", input_shape = c(28*28))
  348. <tensorflow.python.keras.layers.core.Dense>
  349. > layer_dense(units = 10, activation = "softmax")
  350. <tensorflow.python.keras.layers.core.Dense>
  351. > network <- keras_model_sequential() %>%
  352. + layer_dense(units=512, activation ="relu", input_shape = c(28*28))
  353. 2019-10-20 14:35:27.679253: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
  354. > network <- keras_model_sequential() %>%
  355. + network <- keras_model_sequential() %>%
  356. + layer_dense(units=512, activation ="relu", input_shape = c(28*28))
  357. Error in keras_model_sequential() %>% network <- keras_model_sequential() %>%  :
  358.   invalid (NULL) left side of assignment
  359. > network <- keras_model_sequential() %>%
  360. + layer_dense(units=512, activation ="relu", input_shape = c(28*28))
  361. > network <- keras_model_sequential() %>%
  362. + layer_dense(units=512, activation ="relu", input_shape = c(28 * 28)) %>%
  363. + layer_dense(units = 10, activation = "softmax")
  364. >
  365. > str(network)
  366. Model
  367. Model: "sequential_5"
  368. _________________________________________________________________________________
  369. Layer (type)                        Output Shape                    Param #      
  370. =================================================================================
  371. dense_5 (Dense)                     (None, 512)                     401920      
  372. _________________________________________________________________________________
  373. dense_6 (Dense)                     (None, 10)                      5130        
  374. =================================================================================
  375. Total params: 407,050
  376. Trainable params: 407,050
  377. Non-trainable params: 0
  378. _________________________________________________________________________________
  379.  
  380.  
  381. > network %>% compile(optimizer = "rmsprop", loss="categorical_crossentropy", metrics = c("accuracy"))
  382. > train_images <- array_reshape(train_images, c(60000, 28 * 28))
  383. > train_images <- train_images / 255
  384. > test_images <- array_reshape(test_images, c(10000, 28 * 28))
  385. > test_images <- test_images / 255
  386. > train_labels <- to_categorical(train_labels)
  387. > test_labels <- to_categorical(test_labels)
  388. > network %>% fit(train_images, train_labels, epochs = 5, batch_size = 128)
  389. Train on 60000 samples
  390. Epoch 1/5
  391. 60000/60000 [==============================] - 4s 72us/sample - loss: 0.2560 - accuracy: 0.9272
  392. Epoch 2/5
  393. 60000/60000 [==============================] - 4s 62us/sample - loss: 0.1034 - accuracy: 0.9691
  394. Epoch 3/5
  395. 60000/60000 [==============================] - 4s 62us/sample - loss: 0.0679 - accuracy: 0.9797
  396. Epoch 4/5
  397. 60000/60000 [==============================] - 4s 61us/sample - loss: 0.0493 - accuracy: 0.9848
  398. Epoch 5/5
  399. 60000/60000 [==============================] - 4s 59us/sample - loss: 0.0374 - accuracy: 0.9889
  400. > metrics <- network %>% evaluate(test_images, test_labels, verbose = 0)
  401. > metrics
  402. $`loss`
  403. [1] 0.06525226
  404.  
  405. $accuracy
  406. [1] 0.9806
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement