Pycharmでpyファイルを走らせるときに、引数を設定したいときは
メニューファイルのRunの下にある「Edit Configuration」をクリックし、Script Pathの下の「Parameters」に書き込む。
参考リンク
2019年8月24日土曜日
2019年8月8日木曜日
SONY NNC: ver1.50起動
SONY NNC ver1.50が起動しないトラブル(ただ、同じPCにインストールしているver 1.40は普通に起動する。)があったが、Python3.6から3.7にアップデートして、何度かver1.50を起動しているうちに、普通に計算できるようになっていた。
2019年8月4日日曜日
SONY NNC:cli.py(バージョン1.40)
import argparse
import sys
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
def _nnabla_version():
import nnabla
return 'Version {}'.format(nnabla.__version__) + \
', ' + \
'Build {}'.format(nnabla.__build_number__)
def version_command(args):
print(_nnabla_version())
return_value = None
def main():
global return_value
import six.moves._thread as thread
import threading
thread.stack_size(128 * 1024 * 1024)
sys.setrecursionlimit(0x3fffffff)
main_thread = threading.Thread(target=cli_main)
main_thread.start()
main_thread.join()
if not return_value:
sys.exit(-1)
def cli_main():
global return_value
return_value = False
import nnabla
parser = argparse.ArgumentParser(description='Command line interface ' +
'for NNabla({})'.format(_nnabla_version()))
parser.add_argument(
'-m', '--mpi', help='exec with mpi.', action='store_true')
subparsers = parser.add_subparsers()
from nnabla.utils.cli.train import add_train_command
add_train_command(subparsers)
from nnabla.utils.cli.forward import add_infer_command, add_forward_command
add_infer_command(subparsers)
add_forward_command(subparsers)
from nnabla.utils.cli.encode_decode_param import add_decode_param_command, add_encode_param_command
add_encode_param_command(subparsers)
add_decode_param_command(subparsers)
from nnabla.utils.cli.profile import add_profile_command
add_profile_command(subparsers)
from nnabla.utils.cli.conv_dataset import add_conv_dataset_command
add_conv_dataset_command(subparsers)
from nnabla.utils.cli.compare_with_cpu import add_compare_with_cpu_command
add_compare_with_cpu_command(subparsers)
from nnabla.utils.cli.create_image_classification_dataset import add_create_image_classification_dataset_command
add_create_image_classification_dataset_command(subparsers)
from nnabla.utils.cli.uploader import add_upload_command
add_upload_command(subparsers)
from nnabla.utils.cli.uploader import add_create_tar_command
add_create_tar_command(subparsers)
from nnabla.utils.cli.convert import add_convert_command
add_convert_command(subparsers)
from nnabla.utils.cli.func_info import add_function_info_command
add_function_info_command(subparsers)
from nnabla.utils.cli.plot import (
add_plot_series_command, add_plot_timer_command)
add_plot_series_command(subparsers)
add_plot_timer_command(subparsers)
from nnabla.utils.cli.draw_graph import add_draw_graph_command
add_draw_graph_command(subparsers)
# Version
subparser = subparsers.add_parser(
'version', help='Print version and build number.')
subparser.set_defaults(func=version_command)
print('NNabla command line interface (Version {}, Build {})'.format(
nnabla.__version__, nnabla.__build_number__))
args = parser.parse_args()
if 'func' not in args:
parser.print_help(sys.stderr)
return
if args.mpi:
from nnabla.utils.communicator_util import create_communicator
comm = create_communicator()
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
comm.abort()
else:
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
return_value = False
if __name__ == '__main__':
main()
import sys
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
def _nnabla_version():
import nnabla
return 'Version {}'.format(nnabla.__version__) + \
', ' + \
'Build {}'.format(nnabla.__build_number__)
def version_command(args):
print(_nnabla_version())
return_value = None
def main():
global return_value
import six.moves._thread as thread
import threading
thread.stack_size(128 * 1024 * 1024)
sys.setrecursionlimit(0x3fffffff)
main_thread = threading.Thread(target=cli_main)
main_thread.start()
main_thread.join()
if not return_value:
sys.exit(-1)
def cli_main():
global return_value
return_value = False
import nnabla
parser = argparse.ArgumentParser(description='Command line interface ' +
'for NNabla({})'.format(_nnabla_version()))
parser.add_argument(
'-m', '--mpi', help='exec with mpi.', action='store_true')
subparsers = parser.add_subparsers()
from nnabla.utils.cli.train import add_train_command
add_train_command(subparsers)
from nnabla.utils.cli.forward import add_infer_command, add_forward_command
add_infer_command(subparsers)
add_forward_command(subparsers)
from nnabla.utils.cli.encode_decode_param import add_decode_param_command, add_encode_param_command
add_encode_param_command(subparsers)
add_decode_param_command(subparsers)
from nnabla.utils.cli.profile import add_profile_command
add_profile_command(subparsers)
from nnabla.utils.cli.conv_dataset import add_conv_dataset_command
add_conv_dataset_command(subparsers)
from nnabla.utils.cli.compare_with_cpu import add_compare_with_cpu_command
add_compare_with_cpu_command(subparsers)
from nnabla.utils.cli.create_image_classification_dataset import add_create_image_classification_dataset_command
add_create_image_classification_dataset_command(subparsers)
from nnabla.utils.cli.uploader import add_upload_command
add_upload_command(subparsers)
from nnabla.utils.cli.uploader import add_create_tar_command
add_create_tar_command(subparsers)
from nnabla.utils.cli.convert import add_convert_command
add_convert_command(subparsers)
from nnabla.utils.cli.func_info import add_function_info_command
add_function_info_command(subparsers)
from nnabla.utils.cli.plot import (
add_plot_series_command, add_plot_timer_command)
add_plot_series_command(subparsers)
add_plot_timer_command(subparsers)
from nnabla.utils.cli.draw_graph import add_draw_graph_command
add_draw_graph_command(subparsers)
# Version
subparser = subparsers.add_parser(
'version', help='Print version and build number.')
subparser.set_defaults(func=version_command)
print('NNabla command line interface (Version {}, Build {})'.format(
nnabla.__version__, nnabla.__build_number__))
args = parser.parse_args()
if 'func' not in args:
parser.print_help(sys.stderr)
return
if args.mpi:
from nnabla.utils.communicator_util import create_communicator
comm = create_communicator()
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
comm.abort()
else:
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
return_value = False
if __name__ == '__main__':
main()
SONY NNC:cli.py(バージョン1.50)
【バージョン1.50】
import argpars
import sys
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
def _nnabla_version():
import nnabla
import nnabla.utils.callback as callback
version_string = 'Version:{}, Build:{}'.format(nnabla.__version__,
nnabla.__build_number__)
callback_version_string = callback.get_callback_version()
if callback_version_string is not None:
version_string += ', Callback:{}'.format(callback_version_string)
return version_string
def version_command(args):
print(_nnabla_version())
return_value = None
def main():
global return_value
import six.moves._thread as thread
import threading
thread.stack_size(128 * 1024 * 1024)
sys.setrecursionlimit(0x3fffffff)
main_thread = threading.Thread(target=cli_main)
main_thread.start()
main_thread.join()
if not return_value:
sys.exit(-1)
def cli_main():
global return_value
return_value = False
parser = argparse.ArgumentParser(description='Command line interface ' +
'for NNabla({})'.format(_nnabla_version()))
parser.add_argument(
'-m', '--mpi', help='exec with mpi.', action='store_true')
subparsers = parser.add_subparsers()
import nnabla
from nnabla.utils.cli.train import add_train_command
add_train_command(subparsers)
from nnabla.utils.cli.forward import add_infer_command, add_forward_command
add_infer_command(subparsers)
add_forward_command(subparsers)
from nnabla.utils.cli.encode_decode_param import add_decode_param_command, add_encode_param_command
add_encode_param_command(subparsers)
add_decode_param_command(subparsers)
from nnabla.utils.cli.profile import add_profile_command
add_profile_command(subparsers)
from nnabla.utils.cli.conv_dataset import add_conv_dataset_command
add_conv_dataset_command(subparsers)
from nnabla.utils.cli.compare_with_cpu import add_compare_with_cpu_command
add_compare_with_cpu_command(subparsers)
from nnabla.utils.cli.create_image_classification_dataset import add_create_image_classification_dataset_command
add_create_image_classification_dataset_command(subparsers)
from nnabla.utils.cli.uploader import add_upload_command
add_upload_command(subparsers)
from nnabla.utils.cli.uploader import add_create_tar_command
add_create_tar_command(subparsers)
from nnabla.utils.cli.convert import add_convert_command
add_convert_command(subparsers)
from nnabla.utils.cli.func_info import add_function_info_command
add_function_info_command(subparsers)
from nnabla.utils.cli.plot import (
add_plot_series_command, add_plot_timer_command)
add_plot_series_command(subparsers)
add_plot_timer_command(subparsers)
from nnabla.utils.cli.draw_graph import add_draw_graph_command
add_draw_graph_command(subparsers)
# Version
subparser = subparsers.add_parser(
'version', help='Print version and build number.')
subparser.set_defaults(func=version_command)
print('NNabla command line interface ({})'.format(_nnabla_version()))
args = parser.parse_args()
if 'func' not in args:
parser.print_help(sys.stderr)
sys.exit(-1)
if args.mpi:
from nnabla.utils.communicator_util import create_communicator
comm = create_communicator()
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
comm.abort()
else:
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
return_value = False
sys.exit(-1)
if __name__ == '__main__':
main()
import argpars
import sys
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
def _nnabla_version():
import nnabla
import nnabla.utils.callback as callback
version_string = 'Version:{}, Build:{}'.format(nnabla.__version__,
nnabla.__build_number__)
callback_version_string = callback.get_callback_version()
if callback_version_string is not None:
version_string += ', Callback:{}'.format(callback_version_string)
return version_string
def version_command(args):
print(_nnabla_version())
return_value = None
def main():
global return_value
import six.moves._thread as thread
import threading
thread.stack_size(128 * 1024 * 1024)
sys.setrecursionlimit(0x3fffffff)
main_thread = threading.Thread(target=cli_main)
main_thread.start()
main_thread.join()
if not return_value:
sys.exit(-1)
def cli_main():
global return_value
return_value = False
parser = argparse.ArgumentParser(description='Command line interface ' +
'for NNabla({})'.format(_nnabla_version()))
parser.add_argument(
'-m', '--mpi', help='exec with mpi.', action='store_true')
subparsers = parser.add_subparsers()
import nnabla
from nnabla.utils.cli.train import add_train_command
add_train_command(subparsers)
from nnabla.utils.cli.forward import add_infer_command, add_forward_command
add_infer_command(subparsers)
add_forward_command(subparsers)
from nnabla.utils.cli.encode_decode_param import add_decode_param_command, add_encode_param_command
add_encode_param_command(subparsers)
add_decode_param_command(subparsers)
from nnabla.utils.cli.profile import add_profile_command
add_profile_command(subparsers)
from nnabla.utils.cli.conv_dataset import add_conv_dataset_command
add_conv_dataset_command(subparsers)
from nnabla.utils.cli.compare_with_cpu import add_compare_with_cpu_command
add_compare_with_cpu_command(subparsers)
from nnabla.utils.cli.create_image_classification_dataset import add_create_image_classification_dataset_command
add_create_image_classification_dataset_command(subparsers)
from nnabla.utils.cli.uploader import add_upload_command
add_upload_command(subparsers)
from nnabla.utils.cli.uploader import add_create_tar_command
add_create_tar_command(subparsers)
from nnabla.utils.cli.convert import add_convert_command
add_convert_command(subparsers)
from nnabla.utils.cli.func_info import add_function_info_command
add_function_info_command(subparsers)
from nnabla.utils.cli.plot import (
add_plot_series_command, add_plot_timer_command)
add_plot_series_command(subparsers)
add_plot_timer_command(subparsers)
from nnabla.utils.cli.draw_graph import add_draw_graph_command
add_draw_graph_command(subparsers)
# Version
subparser = subparsers.add_parser(
'version', help='Print version and build number.')
subparser.set_defaults(func=version_command)
print('NNabla command line interface ({})'.format(_nnabla_version()))
args = parser.parse_args()
if 'func' not in args:
parser.print_help(sys.stderr)
sys.exit(-1)
if args.mpi:
from nnabla.utils.communicator_util import create_communicator
comm = create_communicator()
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
comm.abort()
else:
try:
return_value = args.func(args)
except:
import traceback
print(traceback.format_exc())
return_value = False
sys.exit(-1)
if __name__ == '__main__':
main()
2019年8月1日木曜日
sony nnc version 1.50をインストールできない
sony nncの新しいバージョン1.50が公開されたので、ダウンロードしてインストールしたところ、インストール自体はできるが、起動させると以下のようなエラーメッセージが表示された。
Traceback (most recent call last):
File "C:\sony_nnc\neural_network_console_150\libs\scripts\plugin.py", line 5, in <module>
from nnabla import logger
File "C:\sony_nnc\neural_network_console_150\libs\nnabla\python\src\nnabla\__init__.py", line 31, in <module>
from .variable import Variable, Context
File "C:\sony_nnc\neural_network_console_150\libs\nnabla\python\src\nnabla\variable.py", line 17, in <module>
from ._variable import Context
File "_nd_array.pxd", line 64, in init nnabla._variable
File "__init__.pxd", line 918, in init nnabla._nd_array
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "_init.pyx", line 56, in nnabla._init.finalize
SystemError: Parent module 'nnabla' not loaded, cannot perform relative import
visual stodioのバージョンを2017から2015に移してもだめだった。
Traceback (most recent call last):
File "C:\sony_nnc\neural_network_console_150\libs\scripts\plugin.py", line 5, in <module>
from nnabla import logger
File "C:\sony_nnc\neural_network_console_150\libs\nnabla\python\src\nnabla\__init__.py", line 31, in <module>
from .variable import Variable, Context
File "C:\sony_nnc\neural_network_console_150\libs\nnabla\python\src\nnabla\variable.py", line 17, in <module>
from ._variable import Context
File "_nd_array.pxd", line 64, in init nnabla._variable
File "__init__.pxd", line 918, in init nnabla._nd_array
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "_init.pyx", line 56, in nnabla._init.finalize
SystemError: Parent module 'nnabla' not loaded, cannot perform relative import
visual stodioのバージョンを2017から2015に移してもだめだった。
登録:
投稿 (Atom)