ラベル AI の投稿を表示しています。 すべての投稿を表示
ラベル AI の投稿を表示しています。 すべての投稿を表示

2025年10月13日月曜日

Duolingo Maxが英会話ビジネスを奪っていく

 Duolingo Maxを購読したけど、凄い。

なにが凄いっていうと、DuolingoのAIアバターと英会話し放題。

もともと、Duolingoは言語学習アプリというイメージだった。

そして、言語学習は、単語、文法とかは学習できて、その分野のスキルはある程度向上できると思っている。

だけど、実際に英会話となると、英語を聞き取って、返答したりといったことが必要で、これは独学だと、習得が大変と思っていた。

なので、海外に住むとか、海外の人と関わるとかで、英会話の場数をこなさないと、英会話は上達は難しいと思っている。

ところが、冒頭のとおり、Duolingo Maxだと、DuolingoのAIアバター会話し放題なので、駅前留学、海外留学、オンライン英会話などを代替することができると思う。

しかも、Duolingo Maxの料金は、個人プラン $22,800$円(月額$1,900$円)なので破格な料金だと思う。(ちなみに、月単位でなく年単位の支払い)

ということで、Duolingo Maxは、かなりおすすめ。

あと、Duolingo Maxもそうだけど、AIがさまざまなビジネスをなくして行っていると思う昨今。

思いつくのでも

  • ググる(調査)
  • 会議の議事録作成
  • 資料の草案
  • プログラムのソースコードの草案
  • 画像生成
  • 動画生成

は、AIで代替できる。当たり前だけど、時代が変わっている。

自分はアプリケーションエンジニアとしてこれまでやってきているが、いつ、職を失ってもおかしくない。会社に属して、依頼のされたシステムや、会社のプロダクトに携わっている作業は、ここ数年で幾分かは、AIに置き換えられる。というか、既に置き換わっているところもある。

これからのエンジニアの生存戦略としては組織に所属するのではなく、自分でなにかしら、サービスを持っていかないと、厳しいのではと思うこの頃である。

2025年4月16日水曜日

生成AIでインベーダーゲーム作成


 生成AIでシューティングものを作成するのはすんなりいかず、何度か修正プロンプトを指示してそれらしい感じにしました。

修正を続けると、以前の修正が含まれてなく、デグレートされる状態になったりするので、修正プロンプトは冗長になるが、細かい指示は重複して何度も行なった方が良さそうです。

以下のリンクでやり取りが見れます。

生成AIでインベーダー作成したプロンプト

このゲームもGitHub Pageで公開しています。

GitHub Pagesで公開したインベーダーゲーム



2025年4月9日水曜日

生成AIでTetrisのゲーム作成

 ChatGPTを壁打ちにTetrisを作成してみた。前回のブロック崩しと同様に言語は単一のhtmlファイル内のVanillaなJavaScriptです。

これも割と短時間でできる。有名なゲームは生成AIで割と簡単にできそうな気がする。ちなみに、シューティングゲームの作成とかを試みたのだが、それはうまくいかずだった。敵機とか自機の辺り判定、被弾後の動作とか細かく指示しないとダメだし。修正案を指示すると、以前に指示した内容が反映されなくデグレートが発生したりする。なので一旦諦めた。

生成したTetrisはGitHub Pagesに公開しているので、興味あれば遊んでみてください。

(PCのキーボードの矢印キーの左、右、下で移動、Q or Wで回転、PでPauseします。)

Tetrisのゲームのページ


2025年4月6日日曜日

生成AIでブロック崩しゲーム作成

ChatGPTを壁打ちにブロック崩しゲームを作成してみた。言語は単一のhtmlファイル内のVanillaなJavaScriptです。

割と短時間でできる。詳細な情報を伝えてあげればもっと精度の良いものが出来そう。

生成したブロック崩しはGitHub Pagesに公開しているので、興味あれば遊んでみてください。

(PCのキーボードの矢印キーの左、右で操作します。ちなみに、私はStage4以降進めない。。)

ブロック崩しのページ


2023年7月3日月曜日

GitHub CopilotをMacのVisual Studio Codeで使用する。

GitHub CopilotをMacのVisual Studio Codeで使用できるようにした。

手順は次のとおり。

https://github.com/features/copilot

で、「Start my free trial」を押下。


「Get access to GitHub Copilot」を押下。


「Submit」を押下。


Suggestions matching public codeのプルダウンの「Allow」を選択。
「Save and get started」を押下。


「→ Visual Studio Code」のリンクを押下


GitHub Copilotの使用方法が記載されているので、確認する。


Visual Studio Codeを開いて、GitHub Copilotのプラグインをインストールする。


画面右下にSign in to use GitHub Copilotのダイアログが表示されるので「Sign in to GitHub」を押下。


「許可」を押下。


ブラウザがアクティブになって、以下の表示になるので、「Authorize Visual-Studio-Code」を押下。


「Visual Studio Codeを開く」を押下。


「開く」を押下。


「Visual Studio Codeを開く」を押下。


これで、GitHub Copilotが使えそうなので、試してみる。
displayMessageというfunctionの定義を入力するとalert…の候補が表示される。


Tabキーを押下すると、表示された候補が反映された。


ちなみに、別の候補を確認したい場合、
次の候補は、Option (⌥) または Alt+]
前の候補は、Option (⌥) または Alt+[
で切り替えることができる。

以下のサイトに説明が記載されている。

2018年4月10日火曜日

MacにTensorFlowの環境構築

最近、会社でAIを業務に活用できないかという観点で、AIのAPIやAIライブラリのTensorFlowを確認している。
会社のMacにはもちろん、TensorFlowをインストールしている。
そんで、自宅MacにもTensorFlowの環境を構築することにした。

参考にしたサイトは次の通り。
Python3 TensorFlow for Mac 環境構築

ちなみにボクのmacOSは、10.13.4(macOS High Sierra)。
実施した手順は次から。
全てターミナルでコマンド入力。

1. Xcode Command Line tools

xcode-select --install
xcode-select: note: install requested for command line developer tools


2. Homebrewは以前にインストールしているので、homebrewからpyenvをインストール。

brew install pyenv
Warning: You are using OS X 10.13.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Installing dependencies for pyenv: autoconf, pkg-config
==> Installing pyenv dependency: autoconf
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
==> Downloading from http://ftp.jaist.ac.jp/pub/GNU/autoconf/autoconf-2.69.tar.g
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69 --with-lispdir=/usr/loc
==> make install
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/

Add the following to your init file to have packages installed by
Homebrew added to your load-path:
(let ((default-directory "/usr/local/share/emacs/site-lisp/"))
  (normal-top-level-add-subdirs-to-load-path))
==> Summary
🍺  /usr/local/Cellar/autoconf/2.69: 70 files, 3.1M, built in 34 seconds
==> Installing pyenv dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
==> Downloading from https://pkg-config.freedesktop.org/releases/pkg-config-0.28
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool -
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/pkg-config20180325-3814-1yqgea/pkg-config-0.28':
configure: error: C compiler cannot create executables
See `config.log' for more details
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': no implicit conversion of nil into String (TypeError)
 from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /usr/local/Library/ENV/4.3/gcc-4.2:4:in `
' READ THIS: https://git.io/brew-troubleshooting /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:359:in `open_http': 422 Unprocessable Entity (GitHub::Error) from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:737:in `buffer_open' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:212:in `block in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:210:in `catch' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:210:in `open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:717:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:31:in `open' from /usr/local/Library/Homebrew/utils.rb:436:in `open' from /usr/local/Library/Homebrew/utils.rb:466:in `issues_matching' from /usr/local/Library/Homebrew/utils.rb:498:in `issues_for_formula' from /usr/local/Library/Homebrew/exceptions.rb:209:in `fetch_issues' from /usr/local/Library/Homebrew/exceptions.rb:205:in `issues' from /usr/local/Library/Homebrew/exceptions.rb:248:in `dump' from /usr/local/Library/brew.rb:160:in `rescue in
' from /usr/local/Library/brew.rb:67:in `
'


3. なんか、怒られた。
「/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:359:in `open_http': 422 Unprocessable Entity (GitHub::Error)」でググってみる。
すると、
次のサイトが見つかった。
Issue with brew installation #4

なんか、「After uninstall brew, and reinstall it, I solved this problem. Hope help.」って書いてある。
homebrewをもう一度インストールしてみよう。(アンインストールはせず、インストールのみした。)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/sbin
/usr/local/share/zsh
/usr/local/share/zsh/site-functions

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Homebrew /usr/local/Frameworks /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Homebrew /usr/local/Frameworks /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown xxxxx /usr/local/Homebrew /usr/local/Frameworks /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Homebrew /usr/local/Frameworks /usr/local/sbin /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /bin/mkdir -p /Users/xxxxx/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/xxxxx/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown xxxxx /Users/xxxxx/Library/Caches/Homebrew
==> Downloading and installing Homebrew...
remote: Counting objects: 99382, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 99382 (delta 27), reused 38 (delta 17), pack-reused 99317
Receiving objects: 100% (99382/99382), 22.67 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (72304/72304), done.
From https://github.com/Homebrew/brew
 * [new branch]          master     -> origin/master
 * [new tag]             0.1        -> 0.1
 * [new tag]             0.2        -> 0.2
 * [new tag]             0.3        -> 0.3
 * [new tag]             0.4        -> 0.4
 * [new tag]             0.5        -> 0.5
 * [new tag]             0.6        -> 0.6
 * [new tag]             0.7        -> 0.7
 * [new tag]             0.7.1      -> 0.7.1
 * [new tag]             0.8        -> 0.8
 * [new tag]             0.8.1      -> 0.8.1
 * [new tag]             0.9        -> 0.9
 * [new tag]             0.9.1      -> 0.9.1
 * [new tag]             0.9.2      -> 0.9.2
 * [new tag]             0.9.3      -> 0.9.3
 * [new tag]             0.9.4      -> 0.9.4
 * [new tag]             0.9.5      -> 0.9.5
 * [new tag]             0.9.8      -> 0.9.8
 * [new tag]             0.9.9      -> 0.9.9
 * [new tag]             1.0.0      -> 1.0.0
 * [new tag]             1.0.1      -> 1.0.1
 * [new tag]             1.0.2      -> 1.0.2
 * [new tag]             1.0.3      -> 1.0.3
 * [new tag]             1.0.4      -> 1.0.4
 * [new tag]             1.0.5      -> 1.0.5
 * [new tag]             1.0.6      -> 1.0.6
 * [new tag]             1.0.7      -> 1.0.7
 * [new tag]             1.0.8      -> 1.0.8
 * [new tag]             1.0.9      -> 1.0.9
 * [new tag]             1.1.0      -> 1.1.0
 * [new tag]             1.1.1      -> 1.1.1
 * [new tag]             1.1.10     -> 1.1.10
 * [new tag]             1.1.11     -> 1.1.11
 * [new tag]             1.1.12     -> 1.1.12
 * [new tag]             1.1.13     -> 1.1.13
 * [new tag]             1.1.2      -> 1.1.2
 * [new tag]             1.1.3      -> 1.1.3
 * [new tag]             1.1.4      -> 1.1.4
 * [new tag]             1.1.5      -> 1.1.5
 * [new tag]             1.1.6      -> 1.1.6
 * [new tag]             1.1.7      -> 1.1.7
 * [new tag]             1.1.8      -> 1.1.8
 * [new tag]             1.1.9      -> 1.1.9
 * [new tag]             1.2.0      -> 1.2.0
 * [new tag]             1.2.1      -> 1.2.1
 * [new tag]             1.2.2      -> 1.2.2
 * [new tag]             1.2.3      -> 1.2.3
 * [new tag]             1.2.4      -> 1.2.4
 * [new tag]             1.2.5      -> 1.2.5
 * [new tag]             1.2.6      -> 1.2.6
 * [new tag]             1.3.0      -> 1.3.0
 * [new tag]             1.3.1      -> 1.3.1
 * [new tag]             1.3.2      -> 1.3.2
 * [new tag]             1.3.3      -> 1.3.3
 * [new tag]             1.3.4      -> 1.3.4
 * [new tag]             1.3.5      -> 1.3.5
 * [new tag]             1.3.6      -> 1.3.6
 * [new tag]             1.3.7      -> 1.3.7
 * [new tag]             1.3.8      -> 1.3.8
 * [new tag]             1.3.9      -> 1.3.9
 * [new tag]             1.4.0      -> 1.4.0
 * [new tag]             1.4.1      -> 1.4.1
 * [new tag]             1.4.2      -> 1.4.2
 * [new tag]             1.4.3      -> 1.4.3
 * [new tag]             1.5.0      -> 1.5.0
 * [new tag]             1.5.1      -> 1.5.1
 * [new tag]             1.5.10     -> 1.5.10
 * [new tag]             1.5.11     -> 1.5.11
 * [new tag]             1.5.12     -> 1.5.12
 * [new tag]             1.5.13     -> 1.5.13
 * [new tag]             1.5.14     -> 1.5.14
 * [new tag]             1.5.2      -> 1.5.2
 * [new tag]             1.5.3      -> 1.5.3
 * [new tag]             1.5.4      -> 1.5.4
 * [new tag]             1.5.5      -> 1.5.5
 * [new tag]             1.5.6      -> 1.5.6
 * [new tag]             1.5.7      -> 1.5.7
 * [new tag]             1.5.8      -> 1.5.8
 * [new tag]             1.5.9      -> 1.5.9
HEAD is now at 7ef1aa6dd Merge pull request #4034 from MikeMcQuaid/faq-installation
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4720, done.
remote: Compressing objects: 100% (4517/4517), done.
remote: Total 4720 (delta 53), reused 641 (delta 16), pack-reused 0
Receiving objects: 100% (4720/4720), 3.84 MiB | 666.00 KiB/s, done.
Resolving deltas: 100% (53/53), done.
Tapped 4516 formulae (4,762 files, 12MB)
==> Cleaning up /Library/Caches/Homebrew...
Removing: /Library/Caches/Homebrew/gradle-2.7.zip... (42.7MB)
Removing: /Library/Caches/Homebrew/pkg-config-0.28.tar.gz... (1.8MB)
==> Migrating /Library/Caches/Homebrew to /Users/xxxxx/Library/Caches/Homebrew...
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

==> Next steps:
- Run `brew help` to get started
- Further documentation:
    https://docs.brew.sh


4. 再度、pyenvをインストール。

brew install pyenv
==> Installing dependencies for pyenv: pkg-config, openssl, readline
==> Installing pyenv dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 627.2KB
==> Installing pyenv dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2o_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2o_1.high_sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2o_1: 1,791 files, 12.3MB
==> Installing pyenv dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-7.0.3_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-7.0.3_1.high_sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only..

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/readline/lib
    CPPFLAGS: -I/usr/local/opt/readline/include

==> Summary
🍺  /usr/local/Cellar/readline/7.0.3_1: 46 files, 1.5MB
==> Installing pyenv
==> Downloading https://homebrew.bintray.com/bottles/pyenv-1.2.3.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pyenv-1.2.3.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/pyenv/1.2.3: 597 files, 2.4MB


5. pyenv-virtualenvをインストール
(5.は不要な気がする。ただ、実際の作業ログとして残しておく。)

brew install pyenv-virtualenv
==> Downloading https://github.com/pyenv/pyenv-virtualenv/archive/v1.1.1.tar.gz
==> Downloading from https://codeload.github.com/pyenv/pyenv-virtualenv/tar.gz/v1.1.1
######################################################################## 100.0%
==> ./install.sh
==> Caveats
To enable auto-activation add to your profile:
  if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
==> Summary
🍺  /usr/local/Cellar/pyenv-virtualenv/1.1.1: 20 files, 60.6KB, built in 3 seconds


6.  TensorFlow環境構築のコマンドを叩く。

pyenv virtualenv 3.6.0 TensorFlow
Requirement already satisfied: setuptools in /Users/xxxxx/.pyenv/versions/3.6.0/envs/TensorFlow/lib/python3.6/site-packages
Requirement already satisfied: pip in /Users/xxxxx/.pyenv/versions/3.6.0/envs/TensorFlow/lib/python3.6/site-packages


7.  6. TensorFlow環境構築のコマンドで設定した内容を反映させるコマンドを叩く。

pyenv rehash


8.  6. と7.で設定した環境に切り替える。

pyenv global TensorFlow


9. Python3をインストール。

brew install python3
==> Installing dependencies for python: gdbm, sqlite, xz
==> Installing python dependency: gdbm
==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.14.1_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gdbm-1.14.1_1.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/gdbm/1.14.1_1: 20 files, 555.7KB
==> Installing python dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.23.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring sqlite-3.23.0.high_sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/sqlite/3.23.0: 11 files, 3MB
==> Installing python dependency: xz
==> Downloading https://homebrew.bintray.com/bottles/xz-5.2.3.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring xz-5.2.3.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/xz/5.2.3: 92 files, 1.4MB
==> Installing python
==> Downloading https://homebrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring python-3.6.5.high_sierra.bottle.tar.gz
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cel
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cel
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cel
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run
  brew install python@2

Pip, setuptools, and wheel have been installed. To update them run
  pip3 install --upgrade pip setuptools wheel

You can install Python packages with
  pip3 install 
They will install into the site-package directory
  /usr/local/lib/python3.6/site-packages

See: https://docs.brew.sh/Homebrew-and-Python
==> Summary
🍺  /usr/local/Cellar/python/3.6.5: 4,705 files, 99.4MB


10. pip3でvirtualenvをインストール。
(前述した5.は不要な気がする。多分、10.があればOK.)

pip3 install virtualenv
Collecting virtualenv
  Downloading virtualenv-15.2.0-py2.py3-none-any.whl (2.6MB)
    100% |████████████████████████████████| 2.6MB 524kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-15.2.0


11. スーパーユーザになる。

su - root
Password:


12.  TensorFlowをインストール。

pip3 install --upgrade tensorflow
Collecting tensorflow
  Downloading tensorflow-1.7.0-cp36-cp36m-macosx_10_11_x86_64.whl (45.3MB)
    100% |################################| 45.3MB 36kB/s
Requirement already up-to-date: numpy>=1.13.3 in /usr/local/lib/python3.6/site-packages (from tensorflow)
Requirement already up-to-date: wheel>=0.26 in /usr/local/lib/python3.6/site-packages (from tensorflow)
Requirement already up-to-date: six>=1.10.0 in /usr/local/lib/python3.6/site-packages (from tensorflow)
Requirement already up-to-date: protobuf>=3.4.0 in /usr/local/lib/python3.6/site-packages (from tensorflow)
Collecting tensorboard<1 .8.0="">=1.7.0 (from tensorflow)
  Downloading tensorboard-1.7.0-py3-none-any.whl (3.1MB)
    100% |################################| 3.1MB 501kB/s
Requirement already up-to-date: grpcio>=1.8.6 in /usr/local/lib/python3.6/site-packages (from tensorflow)
Collecting termcolor>=1.1.0 (from tensorflow)
  Downloading termcolor-1.1.0.tar.gz
Collecting absl-py>=0.1.6 (from tensorflow)
  Downloading absl-py-0.1.13.tar.gz (80kB)
    100% |################################| 81kB 4.8MB/s
Collecting gast>=0.2.0 (from tensorflow)
  Downloading gast-0.2.0.tar.gz
Collecting astor>=0.6.0 (from tensorflow)
  Downloading astor-0.6.2-py2.py3-none-any.whl
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/site-packages (from protobuf>=3.4.0->tensorflow)
Requirement already up-to-date: markdown>=2.6.8 in /usr/local/lib/python3.6/site-packages (from tensorboard<1 .8.0="">=1.7.0->tensorflow)
Requirement already up-to-date: html5lib==0.9999999 in /usr/local/lib/python3.6/site-packages (from tensorboard<1 .8.0="">=1.7.0->tensorflow)
Collecting werkzeug>=0.11.10 (from tensorboard<1 .8.0="">=1.7.0->tensorflow)
  Downloading Werkzeug-0.14.1-py2.py3-none-any.whl (322kB)
    100% |################################| 327kB 2.5MB/s
Requirement already up-to-date: bleach==1.5.0 in /usr/local/lib/python3.6/site-packages (from tensorboard<1 .8.0="">=1.7.0->tensorflow)
Building wheels for collected packages: termcolor, absl-py, gast
  Running setup.py bdist_wheel for termcolor ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/de/f7/bf/1bcac7bf30549e6a4957382e2ecab04c88e513117207067b03
  Running setup.py bdist_wheel for absl-py ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/76/f7/0c/88796d7212af59bb2f496b12267e0605f205170781e9b86479
  Running setup.py bdist_wheel for gast ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/8e/fa/d6/77dd17d18ea23fd7b860e02623d27c1be451521af40dd4a13e
Successfully built termcolor absl-py gast
Installing collected packages: werkzeug, tensorboard, termcolor, absl-py, gast, astor, tensorflow
Successfully installed absl-py-0.1.13 astor-0.6.2 gast-0.2.0 tensorboard-1.7.0 tensorflow-1.7.0 termcolor-1.1.0 werkzeug-0.14.1


13. TensorFlowを動かしてみる。

python3
Python 3.6.5 (default, Mar 30 2018, 06:41:53)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
2018-04-08 23:23:36.689778: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
>>> quit()


TensorFlowが動いた。
これで終わり。

2018年3月22日木曜日

iPhoneのミュージックアプリの曲をAmazon Echoでかける

iPhoneのミュージックアプリの曲をAmazon Echoのスピーカーでかけてみた。
設定手順は次の通り。

iPhoneの設定で、「Bluetooth」をタップ。


「Alexa、ペアリングして。」と、Amazon Echoに喋る。
すると、その他デバイスのところに "Echo-CHP" が表示される。

"Echo-CHP"をタップして接続する。

Alexaアプリを起動して「設定」をタップ。

オンラインになっているEchoをタップする。
(「小林 隆晴さんの Echo」をタップした。)

「Bluetooth」をタップ。

「新しいデバイスをペアリング」をタップ。

しばらく待つ。ちょいと時間がかかる。(2、3分くらいかかった。)

ペアリングされたみたいだ。
なんか、文字化けしているけど。(先頭部分は、"小林隆晴 の"のハズなんだけど。)
この画面でこれ以上の操作はないみたいなので、左上の「<」をタップ。

ペアリング済みのデバイスに"小林隆晴 の iPhone"が追加されている。
この画面では文字化けしてない。
Alexaアプリでの設定はこれで終了。

ミュージックアプリを起動する。
そして、音楽を再生するとAmazon Echoのスピーカーから音楽が流れる。
これで、ひとまず完了。
画面下のタブの上の曲をタップしてみる。



画面下に ペアリングされた"Echo-CHP"って表示されている。


今後、iPhoneのミュージックアプリの曲をAmazon Echoでかける時は
まず、「Alexa、ペアリングして。」と言う。
すると、Amazon Echoがペアリングを検出して接続することを喋ってくれる。
そして、iPhoneのミュージックアプリの曲を再生すればいい。
あと、Amazon Echoとのペアリングを解除するには、「Alexa、ペアリング解除して。」と言えばいい。
ちなみに、ペアリング解除されたら、iPhoneのミュージックアプリの曲の再生も止まる。


Amazon Echoの音声認識の変わり様

Amazon Echoの音声認識は毎日変わっている。
ただ、それがいい様に変わるだけならいいけど、ダメな様に変わることもある。
昨日まで、Alexaに認識させるために、喋っていたことと全く同じことを言ったつもりでも応答が変わってくることもある。

つい数日前まで、Beatlesの曲をかけてもらう時に
「Alexa、Beatlesをかけて。」
で、よかったのだけど、今日同じ様に喋ると応答が変わっていた。


なんか、東京ビートルズってバンドの曲がかかった。
Wikipediaで調べたら、なんか、すごく昔の日本のBeatlesのコピーバンドらしい。
このAlexaの応答はほとんどの人からしたら、期待していない応答だろう。
だから、Alexaは正しく応答してないとフィードバックしておいた。

で、「Alexa、The Beatlesをかけて」と言うと、ちゃんとBeatlesの曲が流れてきた。


まだまだ、音声認識は学習中だ。
使う側もどうしたら、音声認識がどの様に応答するか慣れないといけない。

2018年3月21日水曜日

Watson大丈夫か?

仕事でWatsonのAPIを検証しているので、ちょくちょく使用するのだけど、昨日も午前中はConversation APIが使用できなかった。


右上の緑色の「Lanch tool」ボタンを押すと・・・

エラーが表示された。(Conversation APIの管理画面に進めん。)

なんか、Watsonは時々、このような意味不明のエラーが発生しているのを何度か見た。
以前にも備忘録として本ブログに書いたこともある。


Liteアカウントでなく、有料版のアカウントだったらこんなこと起こらないのだろうか。
とにかく、Watson APIが動いてないって状態がちょくちょくあるんだったら、Watson APIを使用しているサービスを安心して使えんだろう。

2018年2月1日木曜日

WatsonのConversation APIで{"error":"Unable to retrieve session"}

少し前の1/12のことだったけど、WatsonのConversation APIをIBM Cloudの管理画面から操作しようとすると、画面に次のメッセージだけが表示されて何もできなかった時があった。

{"error":"Unable to retrieve session"}

結論から言うと、原因は不明だけどIBM Watsonが使用不可の状態が続いていた。
記憶が定かではないが、少なくとも日本時間で9:00 から 15:00ぐらいまで使えなかったと思う。

その時にキャプチャを取得してたので、備忘録として残しておく。


右の緑の「Launch tool」ボタンを押下して、Conversation APIの管理画面を操作しようとする。
だけど・・・


画面には {"error":"Unable to retrieve session"} の文字だけが表示される。
何か操作方法でも誤ったのかと思いググってみるけど、解決しそうな情報が見つからない。
そんで、その時のConversation APIの管理画面で作業中の内容は仕掛かったばかりのものだったので、Conversation APIの今ある内容を削除して、始めから作り直そうとした。
すると・・・


始めのサービスの作成でエラーが発生。
エラーメッセージは次の通り。

Service broker error: {"code"=>500, "error"=>"Server Error", "description"=>"2018-01-11T23:18:53-06:00, Error ERCDPLTFRM-CONNXERRLDP occurred when accessing https://gateway.watsonplatform.net/common-service-broker/v1/conversation/v2/service_instances/3bfa8999-8b48-4851-a7a7-a6ee82c1e204, Tran-Id: gateway02-137033 - "}

codeが500って内部サーバーエラーだよな、って思い。
このエラーメッセージをググってみる。
そしたら・・・


このサイトが見つかった。
下のメッセージに
Unfortunately there is an ongoing outage.. って書いてある。
なんかIBM Cloudが動いてないんじゃないかな、と思い。
このメッセージのリンクに進む。
すると・・・

AI Watson ServiceがUS-SouthとEU-DEの地域で使えないって書いてある。
だけど、その使えない原因が見当たらないけど。

とういことで、Watsonが使用できないために、Conversation APIの管理画面を開こうとしたら、{"error":"Unable to retrieve session"} ってメッセージが表示されていたのでした。

ただ、こんな有名なAIのAPIのサービスが長い間使用不可になるって不安だよな。
WatsonのAPIを使用してサービス提供してたら大変だよ。
Watsonの管理画面とか使いやすし、チュートリアルもしっかりしているから、今後はAIのAPIはWatsonがいいかもって思ってたけど、他のGoogleとかMicrosoftの方がいいかもしれない。
少なくともボクは、GoogleとかMicrosoftのAPIとかクラウドのサービスが長い間使用不可だったのは見たことはない。

2018年1月5日金曜日

IBM Cloudライト・アカウント

仕事でAI(人工知能)関係の情報を収集していて、昨年末より試してみたかったIBM Cloudライト・アカウント。
なんか、今までのトライアル版と違って利用期間に制限がないんだとか。
なんかAPI使用回数に制限があったり、サービスを長期間使用しないと、せっかくCloud上に用意した情報がクリアされるみたいだけど。
あと、最近、AI(人工知能)でよく聞くWatsonのAPIも制限はあるけれど無料で使えるんだとか。


ちなみに、IBM Couldライト・アカウントはまだ、使い始めたばかりなので、今のところは、そんな感動していない。
ただ、今後というか、今年はこんな感じの人工知能の制限はあるけれど無料のAPIを使って、何かできるか挑戦してみる人が増えると思うから、便利だったり、面白いサービスが世に出たら、それを真似してWebサービスの作り方とか変わるんじゃないかと思うけど。
まぁ、Webサービス作成に人工知能のAPIを使用しないというのは、少なくなると思う。