他的回复:
回复:ModelArts专家-T_c_D 发表于 2020-4-23 17:12 我看到您pip了一些库,keras pip成功但是import 失败,应该是没有pip到PYTHONPATH目录下面,可以发一下您pip库的那一块代码吗 天啊,这鬼排版... os.system('pip3 install -U --pre segmentation-models --user') os.system('pip3 install keras --user') 这是关于命令行的代码 如果不加 -- user选项,那么报错日志如下: Modelarts Service Log]user: uid=1101(work) gid=1101(work) groups=1101(work),1000(HwHiAiUser) [Modelarts Service Log]pwd: /home/work [Modelarts Service Log]app_url: s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/code/ [Modelarts Service Log]boot_file: code/imgseg_0423.py [Modelarts Service Log]log_url: /tmp/log/MA-cnsoft-04-22-15.log [Modelarts Service Log]command: code/imgseg_0423.py --data_url=s3://tuxiangsjj/data/CamVid/ --train_url=s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/output/V0009/ [Modelarts Service Log]MODELARTS_IPOIB_DEVICE: [Modelarts Service Log]dependencies_file_dir: /home/work/user-job-dir/code [Modelarts Service Log][modelarts_create_log] modelarts-pipe found [Modelarts Service Log]handle inputs of training job INFO:root:Using MoXing-v1.16.3- INFO:root:Using OBS-Python-SDK-3.1.2 [ModelArts Service Log]INFO: env MA_INPUTS is not found, skip the inputs handler INFO:root:Using MoXing-v1.16.3- INFO:root:Using OBS-Python-SDK-3.1.2 [ModelArts Service Log]2020-04-23 09:37:01,156 - modelarts-downloader.py[line:612] - INFO: Main: modelarts-downloader starting with Namespace(dst='./', recursive=True, skip_creating_dir=False, src='s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/code/', trace=False, type='common', verbose=False) [Modelarts Service Log][modelarts_logger] modelarts-pipe found /home/work/user-job-dir [Modelarts Service Log][modelarts_logger] modelarts-pipe found [Modelarts Service Log]2020-04-23 09:37:01,456 - INFO - Davinci training command [Modelarts Service Log]2020-04-23 09:37:01,456 - INFO - ['/usr/bin/python', '/home/work/user-job-dir/code/imgseg_0423.py', '--data_url=s3://tuxiangsjj/data/CamVid/', '--train_url=s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/output/V0009/'] [Modelarts Service Log]2020-04-23 09:37:01,456 - INFO - Wait for Rank table ready [Modelarts Service Log]2020-04-23 09:37:01,457 - INFO - Rank table is ready for read [Modelarts Service Log]2020-04-23 09:37:01,457 - INFO - { "status": "completed", "group_count": "1", "group_list": [ { "group_name": "job-ma-cnsoft-04-22-15", "device_count": "1", [Modelarts Service Log]user: uid=1101(work) gid=1101(work) groups=1101(work),1000(HwHiAiUser) [Modelarts Service Log]pwd: /home/work [Modelarts Service Log]app_url: s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/code/ [Modelarts Service Log]boot_file: code/imgseg_0423.py [Modelarts Service Log]log_url: /tmp/log/MA-cnsoft-04-22-15.log [Modelarts Service Log]command: code/imgseg_0423.py --data_url=s3://tuxiangsjj/data/CamVid/ --train_url=s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/output/V0009/ [Modelarts Service Log]MODELARTS_IPOIB_DEVICE: [Modelarts Service Log]dependencies_file_dir: /home/work/user-job-dir/code [Modelarts Service Log][modelarts_create_log] modelarts-pipe found [Modelarts Service Log]handle inputs of training job INFO:root:Using MoXing-v1.16.3- INFO:root:Using OBS-Python-SDK-3.1.2 [ModelArts Service Log]INFO: env MA_INPUTS is not found, skip the inputs handler INFO:root:Using MoXing-v1.16.3- INFO:root:Using OBS-Python-SDK-3.1.2 [ModelArts Service Log]2020-04-23 09:37:01,156 - modelarts-downloader.py[line:612] - INFO: Main: modelarts-downloader starting with Namespace(dst='./', recursive=True, skip_creating_dir=False, src='s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/code/', trace=False, type='common', verbose=False) [Modelarts Service Log][modelarts_logger] modelarts-pipe found /home/work/user-job-dir [Modelarts Service Log][modelarts_logger] modelarts-pipe found [Modelarts Service Log]2020-04-23 09:37:01,456 - INFO - Davinci training command [Modelarts Service Log]2020-04-23 09:37:01,456 - INFO - ['/usr/bin/python', '/home/work/user-job-dir/code/imgseg_0423.py', '--data_url=s3://tuxiangsjj/data/CamVid/', '--train_url=s3://tuxiangsjj/data/test/MA-cnsoft-04-22-15/output/V0009/'] [Modelarts Service Log]2020-04-23 09:37:01,456 - INFO - Wait for Rank table ready [Modelarts Service Log]2020-04-23 09:37:01,457 - INFO - Rank table is ready for read [Modelarts Service Log]2020-04-23 09:37:01,457 - INFO - { "status": "completed", "group_count": "1", "group_list": [ { "group_name": "job-ma-cnsoft-04-22-15", "device_count": "1", "instance_count": "1", "instance_list": [ { "pod_name": "job510ab2e7-job-ma-cnsoft-04-22-15-0", "server_id": "192.168.0.38", "devices": [ { "device_id": "0", "device_ip": "192.1.159.185" } ] } ] } ] } [Modelarts Service Log]2020-04-23 09:37:01,457 - INFO - Slogd startup [Modelarts Service Log]2020-04-23 09:37:01,460 - INFO - FMK of device0 startup INFO:root:Using MoXing-v1.16.3- INFO:root:Using OBS-Python-SDK-3.1.2 Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 108, in _try_except_filenotfounderror try_func() File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1535, in _try_func self._accessor.mkdir(self, mode) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 585, in wrapped return strfunc(str(pathobj), *args) FileNotFoundError: [Errno 2] No such file or directory: '/home/ma-user/.keras/models' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 108, in _try_except_filenotfounderror try_func() File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1535, in _try_func self._accessor.mkdir(self, mode) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 585, in wrapped return strfunc(str(pathobj), *args) FileNotFoundError: [Errno 2] No such file or directory: '/home/ma-user/.keras' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/work/user-job-dir/code/imgseg_0423.py", line 7, in mox.file.copy('s3://tuxiangsjj/data/efficientnet-b0_weights_tf_dim_ordering_tf_kernels_autoaugment_notop.h5', '/home/ma-user/.keras/models/efficientnet-b0_weights_tf_dim_ordering_tf_kernels_autoaugment_notop.h5') File "/usr/local/lib/python3.7/site-packages/moxing/framework/util/runtime.py", line 254, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/moxing/framework/file/file_io.py", line 1616, in copy _download_obs(obs_client, src_bucket_name, src_object_key, dst_object_key) File "/usr/local/lib/python3.7/site-packages/moxing/framework/file/file_io.py", line 1637, in _download_obs make_dirs(os.path.dirname(local_file)) File "/usr/local/lib/python3.7/site-packages/moxing/framework/util/runtime.py", line 254, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/moxing/framework/file/file_io.py", line 1140, in make_dirs Path(object_key).mkdir(parents=True, exist_ok=True) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1544, in mkdir _try_except_filenotfounderror(_try_func, _exc_func) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 110, in _try_except_filenotfounderror except_func(exc) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1540, in _exc_func self.parent.mkdir(parents=True, exist_ok=True) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1544, in mkdir _try_except_filenotfounderror(_try_func, _exc_func) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 110, in _try_except_filenotfounderror except_func(exc) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1540, in _exc_func self.parent.mkdir(parents=True, exist_ok=True) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1544, in mkdir _try_except_filenotfounderror(_try_func, _exc_func) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 108, in _try_except_filenotfounderror try_func() File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 1535, in _try_func self._accessor.mkdir(self, mode) File "/usr/local/lib/python3.7/site-packages/pathlib2/__init__.py", line 585, in wrapped return strfunc(str(pathobj), *args) PermissionError: [Errno 13] Permission denied: '/home/ma-user' [Modelarts Service Log]2020-04-23 09:37:02,463 - ERROR - FMK of device0 exit with non-zero code: 1 === begin proc exit === === begin stop slogd === === end pro exit === [Modelarts Service Log][modelarts_logger] modelarts-pipe found [Modelarts Service Log]RETURN_CODE: 1 [ModelArts Service Log]modelarts-pipe: will create log file /tmp/log/MA-cnsoft-04-22-15.log chown: cannot access '/home/work/modelarts': No such file or directory [ModelArts Service Log]modelarts-pipe: will create log file /tmp/log/MA-cnsoft-04-22-15.log [ModelArts Service Log]modelarts-pipe: will write log file /tmp/log/MA-cnsoft-04-22-15.log [ModelArts Service Log]modelarts-pipe: param for max log length: 1073741824 [ModelArts Service Log]modelarts-pipe: param for whether exit on overflow: 0 [ModelArts Service Log]modelarts-pipe: total length: 24 [ModelArts Service Log]modelarts-pipe: will create log file /tmp/log/MA-cnsoft-04-22-15.log [ModelArts Service Log]modelarts-pipe: will write log file /tmp/log/MA-cnsoft-04-22-15.log [ModelArts Service Log]modelarts-pipe: param for max log length: 1073741824 [ModelArts Service Log]modelarts-pipe: param for whether exit on overflow: 0 [ModelArts Service Log]modelarts-pipe: total length: 5273 [ModelArts Service Log]modelarts-pipe: will create log file /tmp/log/MA-cnsoft-04-22-15.log [ModelArts Service Log]modelarts-pipe: will write log file /tmp/log/MA-cnsoft-04-22-15.log [ModelArts Service Log]modelarts-pipe: param for max log length: 1073741824 [ModelArts Service Log]modelarts-pipe: param for whether exit on overflow: 0 [ModelArts Service Log]modelarts-pipe: total length: 38 [Modelarts Service Log]Training completed.