Closed chiragsanghvi10 closed 4 years ago
@chiragsanghvi10 TensorFlow version ?
@kamalkraj TensorFlow version 2.0
Try installing Tensorflow in a Virtual Env and try again
Yes, I tried this, Does this support GPU?
Getting a RuntimeError now,
2019-12-09 13:55:34.229624: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]
Traceback (most recent call last): File "run_classifer.py", line 452, inapp.run(main) File "/home/vv/git/ALBERT-TF2.0/venv/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/vv/git/ALBERT-TF2.0/venv/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "run_classifer.py", line 302, in main loss_multiplier=loss_multiplier) File "run_classifer.py", line 190, in get_model pooledoutput, = albert_layer(input_word_ids, input_mask, input_type_ids) File "/home/vv/git/ALBERT-TF2.0/albert.py", line 212, in call return super(AlbertModel, self).call(inputs, *kwargs) File "/home/vv/git/ALBERT-TF2.0/venv/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 842, in call outputs = call_fn(cast_inputs, args, **kwargs) File "/home/vv/git/ALBERT-TF2.0/venv/lib/python3.6/site-packages/tensorflow_core/python/autograph/impl/api.py", line 237, in wrapper raise e.ag_error_metadata.to_exception(e) RuntimeError: in converted code: relative to /home/vv/git/ALBERT-TF2.0: albert.py:229 call * word_embeddings = self.embedding_lookup(input_word_ids) venv/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py:817 __call__ self._maybe_build(inputs) venv/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py:2141 _maybe_build self.build(input_shapes) albert.py:273 build dtype=self.dtype) venv/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py:522 add_weight aggregation=aggregation) venv/lib/python3.6/site-packages/tensorflow_core/python/training/tracking/base.py:744 _add_variable_with_custom_getter **kwargs_for_getter) venv/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py:139 make_variable shape=variable_shape if variable_shape else None) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/variables.py:258 __call__ return cls._variable_v1_call(*args, **kwargs) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/variables.py:219 _variable_v1_call shape=shape) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/variables.py:65 getter return captured_getter(captured_previous, **kwargs) venv/lib/python3.6/site-packages/tensorflow_core/python/distribute/distribute_lib.py:1322 creator_with_resource_vars return self._create_variable(*args, **kwargs) venv/lib/python3.6/site-packages/tensorflow_core/python/distribute/one_device_strategy.py:262 _create_variable return next_creator(*args, **kwargs) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/variables.py:197 <lambda> previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/variable_scope.py:2507 default_variable_creator shape=shape) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/variables.py:262 __call__ return super(VariableMetaclass, cls).__call__(*args, **kwargs) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1406 __init__ distribute_strategy=distribute_strategy) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1537 _init_from_args initial_value() if init_from_fn else initial_value, venv/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer_utils.py:119 <lambda> init_val = lambda: initializer(shape, dtype=dtype) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/init_ops_v2.py:343 __call__ self.stddev, dtype) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/init_ops_v2.py:809 truncated_normal shape=shape, mean=mean, stddev=stddev, dtype=dtype, seed=self.seed) venv/lib/python3.6/site-packages/tensorflow_core/python/ops/random_ops.py:171 truncated_normal mean_tensor = ops.convert_to_tensor(mean, dtype=dtype, name="mean") venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1184 convert_to_tensor return convert_to_tensor_v2(value, dtype, preferred_dtype, name) venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1242 convert_to_tensor_v2 as_ref=False) venv/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1296 internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) venv/lib/python3.6/site-packages/tensorflow_core/python/framework/tensor_conversion_registry.py:52 _default_conversion_function return constant_op.constant(value, dtype, name=name) venv/lib/python3.6/site-packages/tensorflow_core/python/framework/constant_op.py:227 constant allow_broadcast=True) venv/lib/python3.6/site-packages/tensorflow_core/python/framework/constant_op.py:235 _constant_impl t = convert_to_eager_tensor(value, ctx, dtype) venv/lib/python3.6/site-packages/tensorflow_core/python/framework/constant_op.py:96 convert_to_eager_tensor return ops.EagerTensor(value, ctx.device_name, dtype) RuntimeError: /job:localhost/replica:0/task:0/device:GPU:0 unknown device.
I have tried installing
pip install tensorflow-gpu==2.0 as well, same error message.
RuntimeError: /job:localhost/replica:0/task:0/device:GPU:0 unknown device.
@chiragsanghvi10 above error is due to cuda verison mismatch, so GPUs are not initialized properly Try running sample programs from TF2.0 examples. and make sure that GPUs are working properly
@kamalkraj Thank you so much I was able to get the Pearson correlation. :+1:
Hi @kamalkraj Thank you for the previous fix.
I am working on STS-B data set and I am executing the following commands in Ubuntu
Error message :
Any idea on the same?