Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- R version 3.5.1 (2018-07-02) -- "Feather Spray"
- Copyright (C) 2018 The R Foundation for Statistical Computing
- Platform: x86_64-w64-mingw32/x64 (64-bit)
- R is free software and comes with ABSOLUTELY NO WARRANTY.
- You are welcome to redistribute it under certain conditions.
- Type 'license()' or 'licence()' for distribution details.
- R is a collaborative project with many contributors.
- Type 'contributors()' for more information and
- 'citation()' on how to cite R or R packages in publications.
- Type 'demo()' for some demos, 'help()' for on-line help, or
- 'help.start()' for an HTML browser interface to help.
- Type 'q()' to quit R.
- > install.packages("keras")
- Installing package into ‘D:/Program Files/Dokumenty/R/win-library/3.5’
- (as ‘lib’ is unspecified)
- also installing the dependencies ‘ps’, ‘glue’, ‘purrr’, ‘jsonlite’, ‘Rcpp’, ‘config’, ‘processx’, ‘yaml’, ‘rstudioapi’, ‘base64enc’, ‘whisker’, ‘tidyselect’, ‘rlang’, ‘generics’, ‘reticulate’, ‘tensorflow’, ‘tfruns’, ‘magrittr’, ‘zeallot’, ‘R6’
- There is a binary version available but the source
- version is later:
- binary source needs_compilation
- purrr 0.3.2 0.3.3 TRUE
- Binaries will be installed
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/ps_1.3.0.zip'
- Content type 'application/zip' length 304406 bytes (297 KB)
- downloaded 297 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/glue_1.3.1.zip'
- Content type 'application/zip' length 172536 bytes (168 KB)
- downloaded 168 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/purrr_0.3.2.zip'
- Content type 'application/zip' length 417465 bytes (407 KB)
- downloaded 407 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/jsonlite_1.6.zip'
- Content type 'application/zip' length 1160780 bytes (1.1 MB)
- downloaded 1.1 MB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/Rcpp_1.0.2.zip'
- Content type 'application/zip' length 4550765 bytes (4.3 MB)
- downloaded 4.3 MB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/config_0.3.zip'
- Content type 'application/zip' length 27186 bytes (26 KB)
- downloaded 26 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/processx_3.4.1.zip'
- Content type 'application/zip' length 407287 bytes (397 KB)
- downloaded 397 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/yaml_2.2.0.zip'
- Content type 'application/zip' length 203571 bytes (198 KB)
- downloaded 198 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rstudioapi_0.10.zip'
- Content type 'application/zip' length 236601 bytes (231 KB)
- downloaded 231 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/base64enc_0.1-3.zip'
- Content type 'application/zip' length 43316 bytes (42 KB)
- downloaded 42 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/whisker_0.4.zip'
- Content type 'application/zip' length 82786 bytes (80 KB)
- downloaded 80 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tidyselect_0.2.5.zip'
- Content type 'application/zip' length 625646 bytes (610 KB)
- downloaded 610 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.4.0.zip'
- Content type 'application/zip' length 1076800 bytes (1.0 MB)
- downloaded 1.0 MB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/generics_0.0.2.zip'
- Content type 'application/zip' length 64258 bytes (62 KB)
- downloaded 62 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/reticulate_1.13.zip'
- Content type 'application/zip' length 1632939 bytes (1.6 MB)
- downloaded 1.6 MB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tensorflow_2.0.0.zip'
- Content type 'application/zip' length 151913 bytes (148 KB)
- downloaded 148 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/tfruns_1.4.zip'
- Content type 'application/zip' length 1478786 bytes (1.4 MB)
- downloaded 1.4 MB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/magrittr_1.5.zip'
- Content type 'application/zip' length 155654 bytes (152 KB)
- downloaded 152 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/zeallot_0.1.0.zip'
- Content type 'application/zip' length 61450 bytes (60 KB)
- downloaded 60 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/R6_2.4.0.zip'
- Content type 'application/zip' length 58359 bytes (56 KB)
- downloaded 56 KB
- trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/keras_2.2.5.0.zip'
- Content type 'application/zip' length 3926715 bytes (3.7 MB)
- downloaded 3.7 MB
- package ‘ps’ successfully unpacked and MD5 sums checked
- package ‘glue’ successfully unpacked and MD5 sums checked
- package ‘purrr’ successfully unpacked and MD5 sums checked
- package ‘jsonlite’ successfully unpacked and MD5 sums checked
- package ‘Rcpp’ successfully unpacked and MD5 sums checked
- package ‘config’ successfully unpacked and MD5 sums checked
- package ‘processx’ successfully unpacked and MD5 sums checked
- package ‘yaml’ successfully unpacked and MD5 sums checked
- package ‘rstudioapi’ successfully unpacked and MD5 sums checked
- package ‘base64enc’ successfully unpacked and MD5 sums checked
- package ‘whisker’ successfully unpacked and MD5 sums checked
- package ‘tidyselect’ successfully unpacked and MD5 sums checked
- package ‘rlang’ successfully unpacked and MD5 sums checked
- package ‘generics’ successfully unpacked and MD5 sums checked
- package ‘reticulate’ successfully unpacked and MD5 sums checked
- package ‘tensorflow’ successfully unpacked and MD5 sums checked
- package ‘tfruns’ successfully unpacked and MD5 sums checked
- package ‘magrittr’ successfully unpacked and MD5 sums checked
- package ‘zeallot’ successfully unpacked and MD5 sums checked
- package ‘R6’ successfully unpacked and MD5 sums checked
- package ‘keras’ successfully unpacked and MD5 sums checked
- The downloaded binary packages are in
- C:\Users\Student\AppData\Local\Temp\RtmpYtHPQj\downloaded_packages
- > library(keras)
- Warning message:
- pakiet ‘keras’ został zbudowany w wersji R 3.5.3
- > mnist <- dataset_mnist()
- Error in initialize_python(required_module, use_environment) :
- Installation of Python not found, Python bindings not loaded.
- > mnist <- dataset_mnist()
- Error in initialize_python(required_module, use_environment) :
- Installation of Python not found, Python bindings not loaded.
- > mnist <- dataset_mnist()
- Error in initialize_python(required_module, use_environment) :
- Installation of Python not found, Python bindings not loaded.
- > install_keras()
- Error: Keras installation failed (no conda binary found)
- Install Anaconda for Python 3.x (https://www.anaconda.com/download/#windows)
- before installing Keras.
- > mnist <- dataset_mnist()
- Error in initialize_python(required_module, use_environment) :
- Installation of Python not found, Python bindings not loaded.
- > install_keras()
- Error: Keras installation failed (no conda binary found)
- Install Anaconda for Python 3.x (https://www.anaconda.com/download/#windows)
- before installing Keras.
- > install_keras()
- Collecting package metadata (current_repodata.json): ...working... done
- Solving environment: ...working... done
- ## Package Plan ##
- environment location: C:\Users\Student\ANACON~1\envs\r-reticulate
- added / updated specs:
- - python=3.6
- The following packages will be downloaded:
- package | build
- ---------------------------|-----------------
- certifi-2019.9.11 | py36_0 155 KB
- pip-19.2.3 | py36_0 1.9 MB
- python-3.6.9 | h5500b2f_0 15.9 MB
- setuptools-41.4.0 | py36_0 679 KB
- wheel-0.33.6 | py36_0 58 KB
- wincertstore-0.2 | py36h7fe50ca_0 14 KB
- ------------------------------------------------------------
- Total: 18.7 MB
- The following NEW packages will be INSTALLED:
- certifi pkgs/main/win-64::certifi-2019.9.11-py36_0
- pip pkgs/main/win-64::pip-19.2.3-py36_0
- python pkgs/main/win-64::python-3.6.9-h5500b2f_0
- setuptools pkgs/main/win-64::setuptools-41.4.0-py36_0
- sqlite pkgs/main/win-64::sqlite-3.30.0-he774522_0
- vc pkgs/main/win-64::vc-14.1-h0510ff6_4
- vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.16.27012-hf0eaf9b_0
- wheel pkgs/main/win-64::wheel-0.33.6-py36_0
- wincertstore pkgs/main/win-64::wincertstore-0.2-py36h7fe50ca_0
- Downloading and Extracting Packages
- pip-19.2.3 | 1.9 MB | ########## | 100%
- wincertstore-0.2 | 14 KB | ########## | 100%
- wheel-0.33.6 | 58 KB | ########## | 100%
- python-3.6.9 | 15.9 MB | ########## | 100%
- certifi-2019.9.11 | 155 KB | ########## | 100%
- setuptools-41.4.0 | 679 KB | ########## | 100%
- Preparing transaction: ...working... done
- Verifying transaction: ...working... done
- Executing transaction: ...working... done
- #
- # To activate this environment, use
- #
- # $ conda activate r-reticulate
- #
- # To deactivate an active environment, use
- #
- # $ conda deactivate
- D:\Program Files\Dokumenty>conda.bat activate r-reticulate
- Collecting tensorflow==2.0.0
- Downloading https://files.pythonhosted.org/packages/d3/af/296748d4c8d8987423231b93aecce5ab5952f6f2243cb6cedb88dd425397/tensorflow-2.0.0-cp36-cp36m-win_amd64.whl (48.1MB)
- Collecting keras
- Downloading https://files.pythonhosted.org/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl (377kB)
- Collecting tensorflow-hub
- Downloading https://files.pythonhosted.org/packages/ac/64/3bba86ca49ef21a4add11a4d37e3f6cd05d2e61d207ebe26a8a96b340826/tensorflow_hub-0.6.0-py2.py3-none-any.whl (84kB)
- Collecting h5py
- Downloading https://files.pythonhosted.org/packages/0b/fa/bee65d2dbdbd3611702aafd128139c53c90a1285f169ba5467aab252e27a/h5py-2.10.0-cp36-cp36m-win_amd64.whl (2.4MB)
- Collecting pyyaml
- Downloading https://files.pythonhosted.org/packages/76/da/60f8d638d81d64db4ed3c279c22eb3a1eebfcde6130fee678940e603b930/PyYAML-5.1.2-cp36-cp36m-win_amd64.whl (214kB)
- Collecting requests
- Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
- Collecting Pillow
- Downloading https://files.pythonhosted.org/packages/b7/37/294a6ef8506cfebf8925c22d507fab7ea10e8279c915653571472ee903e1/Pillow-6.2.0-cp36-cp36m-win_amd64.whl (2.0MB)
- Collecting scipy
- Downloading https://files.pythonhosted.org/packages/e1/63/d919e16c5bd3502a0f7675f217625bd6f49a412cc1a856aa6b4b5b5b20bc/scipy-1.3.1-cp36-cp36m-win_amd64.whl (30.5MB)
- Collecting absl-py>=0.7.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/3b/72/e6e483e2db953c11efa44ee21c5fdb6505c4dffa447b4263ca8af6676b62/absl-py-0.8.1.tar.gz (103kB)
- Collecting protobuf>=3.6.1 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/2d/73/4a14606fa26f186e23015bc974f9010e2bbf1607f372e3bd5e82d2a62f1b/protobuf-3.10.0-cp36-cp36m-win_amd64.whl (1.1MB)
- Collecting tensorboard<2.1.0,>=2.0.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/9b/a6/e8ffa4e2ddb216449d34cfcb825ebb38206bee5c4553d69e7bc8bc2c5d64/tensorboard-2.0.0-py3-none-any.whl (3.8MB)
- Collecting wrapt>=1.11.1 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/23/84/323c2415280bc4fc880ac5050dddfb3c8062c2552b34c2e512eb4aa68f79/wrapt-1.11.2.tar.gz
- Collecting astor>=0.6.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/d1/4f/950dfae467b384fc96bc6469de25d832534f6b4441033c39f914efd13418/astor-0.8.0-py2.py3-none-any.whl
- Collecting keras-preprocessing>=1.0.5 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/28/6a/8c1f62c37212d9fc441a7e26736df51ce6f0e38455816445471f10da4f0a/Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41kB)
- Collecting tensorflow-estimator<2.1.0,>=2.0.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/fc/08/8b927337b7019c374719145d1dceba21a8bb909b93b1ad6f8fb7d22c1ca1/tensorflow_estimator-2.0.1-py2.py3-none-any.whl (449kB)
- Collecting termcolor>=1.1.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
- 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)
- Collecting keras-applications>=1.0.8 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
- Collecting opt-einsum>=2.3.2 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/b8/83/755bd5324777875e9dff19c2e59daec837d0378c09196634524a3d7269ac/opt_einsum-3.1.0.tar.gz (69kB)
- Collecting numpy<2.0,>=1.16.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/55/7a/f32b39164262765b069b0fe3ec5d4b47580c9c60f7bd3588b58ba8e93a4c/numpy-1.17.3-cp36-cp36m-win_amd64.whl (12.7MB)
- Collecting gast==0.2.2 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
- Collecting grpcio>=1.8.6 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/4b/75/35bb3a14f671c34ecda9d621b5f363b02011baf67c4c0c6ce6b9e9aa4ddc/grpcio-1.24.1-cp36-cp36m-win_amd64.whl (1.8MB)
- Collecting google-pasta>=0.1.6 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/d0/33/376510eb8d6246f3c30545f416b2263eee461e40940c2a4413c711bdf62d/google_pasta-0.1.7-py3-none-any.whl (52kB)
- Collecting six>=1.10.0 (from tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
- 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)
- Collecting chardet<3.1.0,>=3.0.2 (from requests)
- Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
- Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
- Downloading https://files.pythonhosted.org/packages/e0/da/55f51ea951e1b7c63a579c09dd7db825bb730ec1fe9c0180fc77bfb31448/urllib3-1.25.6-py2.py3-none-any.whl (125kB)
- Collecting idna<2.9,>=2.5 (from requests)
- Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
- 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)
- Collecting markdown>=2.6.8 (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/c0/4e/fd492e91abdc2d2fcb70ef453064d980688762079397f779758e055f6575/Markdown-3.1.1-py2.py3-none-any.whl (87kB)
- Collecting werkzeug>=0.11.15 (from tensorboard<2.1.0,>=2.0.0->tensorflow==2.0.0)
- Downloading https://files.pythonhosted.org/packages/ce/42/3aeda98f96e85fd26180534d36570e4d18108d62ae36f87694b476b83d6f/Werkzeug-0.16.0-py2.py3-none-any.whl (327kB)
- Building wheels for collected packages: absl-py, wrapt, termcolor, opt-einsum, gast
- Building wheel for absl-py (setup.py): started
- Building wheel for absl-py (setup.py): finished with status 'done'
- Created wheel for absl-py: filename=absl_py-0.8.1-cp36-none-any.whl size=121171 sha256=2df1b317a9981d261a884ac374bffb447951f5595726b4f0613d475bc4151030
- Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\a7\15\a0\0a0561549ad11cdc1bc8fa1191a353efd30facf6bfb507aefc
- Building wheel for wrapt (setup.py): started
- Building wheel for wrapt (setup.py): finished with status 'done'
- Created wheel for wrapt: filename=wrapt-1.11.2-cp36-none-any.whl size=19597 sha256=575c364e8598c44a137178d3c60aa61f1bcee35186f2bd02202f51985de9e929
- Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\d7\de\2e\efa132238792efb6459a96e85916ef8597fcb3d2ae51590dfd
- Building wheel for termcolor (setup.py): started
- Building wheel for termcolor (setup.py): finished with status 'done'
- Created wheel for termcolor: filename=termcolor-1.1.0-cp36-none-any.whl size=4835 sha256=affac11ea9b77cd00d04da7375506e31f9f9abf972f1eeb21323129dc671c60b
- Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\7c\06\54\bc84598ba1daf8f970247f550b175aaaee85f68b4b0c5ab2c6
- Building wheel for opt-einsum (setup.py): started
- Building wheel for opt-einsum (setup.py): finished with status 'done'
- Created wheel for opt-einsum: filename=opt_einsum-3.1.0-cp36-none-any.whl size=61701 sha256=a03c5086d0380e6c472d8595102e7b84bb8ca73eb0666561af0e89e0b1bb465b
- Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\2c\b1\94\43d03e130b929aae7ba3f8d15cbd7bc0d1cb5bb38a5c721833
- Building wheel for gast (setup.py): started
- Building wheel for gast (setup.py): finished with status 'done'
- Created wheel for gast: filename=gast-0.2.2-cp36-none-any.whl size=7547 sha256=674f47039570467ac25b889000c71159e23a8bc706099e48594a03b11c63ace5
- Stored in directory: C:\Users\Student\AppData\Local\pip\Cache\wheels\5c\2e\7e\a1d4d4fcebe6c381f378ce7743a3ced3699feb89bcfbdadadd
- Successfully built absl-py wrapt termcolor opt-einsum gast
- 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
- 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
- Installation complete.
- > library(keras)
- >
- > mnist <- dataset_mnist()
- Restarting R session...
- >
- > train_images <- mnist$train$x
- Error: object 'mnist' not found
- > mnist <- dataset_mnist()
- Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
- 11493376/11490434 [==============================] - 5s 0us/step
- > train_images <- mnist$train$x
- > train_labels <- mnist$train$y
- > test_images <- mnist$test$x
- > test_images <- mnist$test$y
- > ````
- Error: attempt to use zero-length variable name
- > str(train_images)
- int [1:60000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
- > str(train_labels)
- int [1:60000(1d)] 5 0 4 1 9 2 1 3 1 4 ...
- > str(test_images)
- int [1:10000(1d)] 7 2 1 0 4 1 4 9 5 9 ...
- > str(test_labels)
- Error in str(test_labels) : object 'test_labels' not found
- > test_images <- mnist$test$x
- > test_labels <- mnist$test$y
- > str(test_images)
- int [1:10000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
- > str(test_labels)
- int [1:10000(1d)] 7 2 1 0 4 1 4 9 5 9 ...
- > network <- keras_model_sequential() %>%
- +
- + network <- keras_model_sequential()
- Error in keras_model_sequential() %>% network <- keras_model_sequential() :
- invalid (NULL) left side of assignment
- > network <- keras_model_sequential()
- > layer_dense(units=512, activation ="relu", input_shape = c(28*28))
- <tensorflow.python.keras.layers.core.Dense>
- > layer_dense(units = 10, activation = "softmax")
- <tensorflow.python.keras.layers.core.Dense>
- > network <- keras_model_sequential() %>%
- + layer_dense(units=512, activation ="relu", input_shape = c(28*28))
- 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
- > network <- keras_model_sequential() %>%
- + network <- keras_model_sequential() %>%
- + layer_dense(units=512, activation ="relu", input_shape = c(28*28))
- Error in keras_model_sequential() %>% network <- keras_model_sequential() %>% :
- invalid (NULL) left side of assignment
- > network <- keras_model_sequential() %>%
- + layer_dense(units=512, activation ="relu", input_shape = c(28*28))
- > network <- keras_model_sequential() %>%
- + layer_dense(units=512, activation ="relu", input_shape = c(28 * 28)) %>%
- + layer_dense(units = 10, activation = "softmax")
- >
- > str(network)
- Model
- Model: "sequential_5"
- _________________________________________________________________________________
- Layer (type) Output Shape Param #
- =================================================================================
- dense_5 (Dense) (None, 512) 401920
- _________________________________________________________________________________
- dense_6 (Dense) (None, 10) 5130
- =================================================================================
- Total params: 407,050
- Trainable params: 407,050
- Non-trainable params: 0
- _________________________________________________________________________________
- > network %>% compile(optimizer = "rmsprop", loss="categorical_crossentropy", metrics = c("accuracy"))
- > train_images <- array_reshape(train_images, c(60000, 28 * 28))
- > train_images <- train_images / 255
- > test_images <- array_reshape(test_images, c(10000, 28 * 28))
- > test_images <- test_images / 255
- > train_labels <- to_categorical(train_labels)
- > test_labels <- to_categorical(test_labels)
- > network %>% fit(train_images, train_labels, epochs = 5, batch_size = 128)
- Train on 60000 samples
- Epoch 1/5
- 60000/60000 [==============================] - 4s 72us/sample - loss: 0.2560 - accuracy: 0.9272
- Epoch 2/5
- 60000/60000 [==============================] - 4s 62us/sample - loss: 0.1034 - accuracy: 0.9691
- Epoch 3/5
- 60000/60000 [==============================] - 4s 62us/sample - loss: 0.0679 - accuracy: 0.9797
- Epoch 4/5
- 60000/60000 [==============================] - 4s 61us/sample - loss: 0.0493 - accuracy: 0.9848
- Epoch 5/5
- 60000/60000 [==============================] - 4s 59us/sample - loss: 0.0374 - accuracy: 0.9889
- > metrics <- network %>% evaluate(test_images, test_labels, verbose = 0)
- > metrics
- $`loss`
- [1] 0.06525226
- $accuracy
- [1] 0.9806
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement