v2 init error on MAC
Created by: guoshengCS
when executing paddle.init
on MAC, following errors occurred:
Traceback (most recent call last):
File "paddle_demo_final.py", line 63, in <module>
paddle.init(use_gpu=False, trainer_count=1)
File "/Users/baidu/build_doc/build_env/lib/python2.7/site-packages/paddle/v2/__init__.py", line 133, in init
set_omp_mkl_env_vars(kwargs.get('trainer_count', 1))
File "/Users/baidu/build_doc/build_env/lib/python2.7/site-packages/paddle/v2/__init__.py", line 105, in set_omp_mkl_env_vars
num_cores = num_physical_cores()
File "/Users/baidu/build_doc/build_env/lib/python2.7/site-packages/paddle/v2/__init__.py", line 95, in num_physical_cores
return int(os.popen(cmds.get(platform.system(), "expr 1")).read())
ValueError: invalid literal for int() with base 10: 'hw.physicalcpu: 2\n'
It seems that os.popen(cmds.get(platform.system(), "expr 1")
returns hw.physicalcpu: 2\n
rather than an integer.