Bin object : TypeError: 'Iterator' object is not iterable

Hello.
Thank you in advance for your reply.
I run my code on a jetson nano with python3.
when i call iterator(function : iterate_element(), iterate_recurse(), …) in bin or pipeline, I have a Type error below.

TypeError: ‘Iterator’ object is not iterable

I write a way that reproduce this issue below.
Can i get some advice ?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
jetson nano
• DeepStream Version
5.0.1-1
• JetPack Version (valid for Jetson only)
32.4.3
• TensorRT Version
7.1.3.0-1+cuda10.2
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
bugs
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

$ python3
import gi
gi.require_version(‘Gst’, ‘1.0’)
from gi.repository import GObject, Gst, GLib
import pyds
Gst.init(None)
GObject.threads_init()
pipeline = Gst.Pipeline.new()
for element in pipeline.iterate_elements():
element.get_name()

TypeError: ‘Iterator’ object is not iterable

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hi,
Please check the webpage:

Maybe you need to put the pipeline in:

my_pipeline = Gst.Pipeline.new("my-pipeline")

Thank you for your reply.

I think that write pipeline name like “my-pipeline” is meaningless.
because if you don’t set name, gstreamer set name internally as pipeline0.
And i tested with putting name as “my-pipeline”, but i still have error to iterate “Iterator”

I think you don’t understand my question.
My question is why “Iterator” could not iterate in “for”, when I tested deepstream with python3 on Jetson nano.

When I tested deepstream with python3 on GPU, it worked well. All “Iterator” can use in “for”.

I checked iterator in pipeline.iterate_elements()

dir(pipeline.iterate_elements())
[‘class’, ‘del’, ‘delattr’, ‘dict’, ‘dir’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘gt’, ‘gtype’, ‘hash’, ‘info’, ‘init’, ‘init_subclass’, ‘le’, ‘lt’, ‘module’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘weakref’, ‘_free_on_dealloc’, ‘_gst_reserved’, ‘cookie’, ‘copy’, ‘filter’, ‘find_custom’, ‘fold’, ‘foreach’, ‘free’, ‘item’, ‘lock’, ‘master_cookie’, ‘new_single’, ‘next’, ‘push’, ‘pushed’, ‘resync’, ‘size’, ‘type’]

pipeline.iterate_elements() don’t have iter

I solve the problem. there is next in Iterator.
I should use “while” than “for”