import zoo.common.nncontext as nncon
nncon.init_engine()
to the new code below:
from bigdl.dllib.nncontext import init_nncontext
sc = init_nncontext()
Is that equivalent? I encounter error below when running the new code. May you tell me what's the right way to translate the old code? Thanks!
Clare
Error message:
> sc = init_nncontext()
test_dl_pipeline.py:65:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../../../../opt/anaconda3/envs/cos_env_upgrade/lib/python3.7/site-packages/bigdl/dllib/nncontext.py:536: in init_nncontext
sc = init_internal_nncontext(conf, spark_log_level, redirect_spark_log)
../../../../../opt/anaconda3/envs/cos_env_upgrade/lib/python3.7/site-packages/bigdl/dllib/nncontext.py:665: in init_internal_nncontext
redire_spark_logs()
../../../../../opt/anaconda3/envs/cos_env_upgrade/lib/python3.7/site-packages/bigdl/dllib/utils/common.py:476: in redire_spark_logs
callBigDlFunc(bigdl_type, "redirectSparkLogs", log_path)
../../../../../opt/anaconda3/envs/cos_env_upgrade/lib/python3.7/site-packages/bigdl/dllib/utils/common.py:623: in callBigDlFunc
for jinvoker in JavaCreator.instance(bigdl_type, gateway).value:
../../../../../opt/anaconda3/envs/cos_env_upgrade/lib/python3.7/site-packages/bigdl/dllib/utils/common.py:58: in instance
cls._instance = cls(bigdl_type, *args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <bigdl.dllib.utils.common.JavaCreator object at 0x7fdbd2919e10>
bigdl_type = 'float'
gateway = <py4j.java_gateway.JavaGateway object at 0x7fdbc1cced50>
def __init__(self, bigdl_type, gateway):
self.value = []
for creator_class in JavaCreator.get_creator_class():
jclass = getattr(gateway.jvm, creator_class)
if bigdl_type == "float":
> self.value.append(getattr(jclass, "ofFloat")())
E TypeError: 'JavaPackage' object is not callable
../../../../../opt/anaconda3/envs/cos_env_upgrade/lib/python3.7/site-packages/bigdl/dllib/utils/common.py:108: TypeError