-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu Tensor indexer null exception #1220
Comments
Here is a breaking test file seems to error for
|
Hello, please create tensor from NDArray in your case. For more information about how to create a tensor, you can refer to the source code. |
I was writing unit tests around a method that takes a 1D Tensor then extracts each element from it (each one still as a Tensor) I think the code above fails because the Tensor has not yet been calculated in a graph. If I make this replacement in the test above it then passes:
|
@Wanglongzhi2001 your right constructing the Tensor from NDArray also works fine, thankyou.
I'll close the issue. What a great project. I'm finding using BARD rather than ChatGPT to help with coding works better as the code examples it generates are more up to date. |
Description
My system is:
Unix 5.15.0.88
64Bit Operating System: True
.NET CLR: 6.0.25
TensorFlow Binary v2.15.0-rc1
TensorFlow.NET v0.150.0.0
TensorFlow.Keras v0.15.0.0
Ubuntu 20.04.6 LTS
My code amounts to this:
While a produces the expected float array, h1 produces the exception below.
Exception has occurred: CLR/System.NullReferenceException
An unhandled exception of type 'System.NullReferenceException' occurred in Tensorflow.Binding.dll: 'Object reference not set to an instance of an object.'
at Tensorflow.Operation.op_Implicit(Operation op)
at Tensorflow.Tensor._as_tf_output()
at Tensorflow.ops.create_c_op(Graph graph, NodeDef node_def, Tensor[] inputs, Operation[] control_inputs, OpDef op_def)
at Tensorflow.Operation..ctor(NodeDef node_def, Graph g, Tensor[] inputs, TF_DataType[] output_types, ITensorOrOperation[] control_inputs, TF_DataType[] input_types, String original_op, OpDef op_def)
at Tensorflow.Graph.create_op(String op_type, Tensor[] inputs, TF_DataType[] dtypes, TF_DataType[] input_types, String name, Dictionary
2 attrs, OpDef op_def, Boolean compute_device) at Tensorflow.OpDefLibrary._apply_op_helper(String op_type_name, String name, Dictionary
2 keywords)at Tensorflow.Contexts.Context.ExecGraphAction(String OpType, String Name, ExecuteOpArgs args)
at Tensorflow.Contexts.Context.ExecuteOp(String opType, String name, ExecuteOpArgs args)
at Tensorflow.array_ops.strided_slice(Tensor input, Tensor begin, Tensor end, Tensor strides, Int32 begin_mask, Int32 end_mask, Int32 ellipsis_mask, Int32 new_axis_mask, Int32 shrink_axis_mask, String name)
at Tensorflow.Tensor.<>c__DisplayClass146_0.b__0(NameScope scope)
at Tensorflow.Binding.tf_with[TIn,TOut](TIn py, Func`2 action)
at Tensorflow.Tensor.slice(Int32 start)
at Tensorflow.Tensor.get_Item(Int32 idx)
Am I missing part of what is required to make TensorFlow.NET work. This for example gives me no results, but I don't think it is required is it? pip show tensorflow
Reproduction Steps
No response
Known Workarounds
No response
Configuration and Other Information
No response
The text was updated successfully, but these errors were encountered: