Skip to content

Segmentation Fault #41

Description

@gulcancan

Hi,

Thank you for your effort in this project!

We are trying to use this repo to run a Tensorflow image segmentation model on Elixir. Please see the code below.

{:ok, graph} = Tensorflex.read_graph("./frozen_inference_graph.pb")

{:ok, input_tensor} = Tensorflex.load_image_as_tensor("example.jpg")

out_dims = Tensorflex.create_matrix(1,3,[[513,431,1]])

{:ok, output_tensor} = Tensorflex.float32_tensor_alloc(out_dims)

results = Tensorflex.run_session(graph, input_tensor, output_tensor, "ImageTensor", "SemanticPredictions")

Unfortunately, we get a segmentation fault error. Please see the stack trace in gdb below.

(gdb) bt #0 0x00007fe846a53701 in TF_NumDims () from /usr/local/lib/libtensorflow.so #1 0x00007fe8c6e3ad14 in run_session (env=0x7fe8c7cfbd80, argc=<optimized out>, argv=<optimized out>) at c_src/Tensorflex.c:696 #2 0x000055e2cd8fc042 in process_main () at x86_64-unknown-linux-gnu/opt/smp/beam_cold.h:119 #3 0x000055e2cd8eddbd in sched_thread_func (vesdp=0x7fe8cd2e3900) at beam/erl_process.c:8332 #4 0x000055e2cdb2fbcd in thr_wrapper (vtwd=0x7ffc34ad3050) at pthread/ethread.c:118 #5 0x00007fe9100f26db in start_thread (arg=0x7fe8c7cfc700) at pthread_create.c:463 #6 0x00007fe90fc1388f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

After digging up the issue, we came up with the conclusion that it originates from the allocation of "output_tensor" variable. Could you please help us on the issue? If you would like to populate the error, you can use any pretrained image segmentation model from the tensorflow deeplab model zoo page.
Looking forward to your reply.
Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions