question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File "Object_detection_picamera.py", line 137, in <module> error

See original GitHub issue
pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py
Traceback (most recent call last):
  File "Object_detection_picamera.py", line 137, in <module>
    frame.setflags(write=1)
ValueError: cannot set WRITEABLE flag to True of this array

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
EdjeElectronicscommented, Jan 21, 2019

For now, I have changed line 136 in Object_detection_picamera.py from

frame = frame1.array

to

frame = np.copy(frame1.array)
0reactions
yeroc-sebrofcommented, Oct 12, 2021

Bumping this for the Pi 4B, running as root still getting this ValueError. The np.copy() function takes up a fair chunk of real-time processing so I’d really like to set writable. I’ve tested all the way back from 1.13 to 1.06 and this issue is present for all versions that had PiRGBAnalysis. Looking into the other flags that are set it appears that the OWNMEMORY flag isn’t set, not sure if this means that the frame data is in GPU memory or some onboard camera memory?

Should I be using something other than PiRGBAnalysis for performing JIT edits? I’d assume something like a custom write format would have performed any copy to main memory at a lower level and would be faster than a np.copy()?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: no module named Python Error [Fixed]
When you try to import a module in a Python file, Python tries to resolve this module in several ways. · As the...
Read more >
Process finished with exit code 137 in PyCharm - Stack Overflow
Exit code 137 means that your process was killed by (signal 9) SIGKILL . In the case you manually stopped it - there's...
Read more >
Train Deep learning model error - Esri Community
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\learn\models\_retinanet.py", line 137, ...
Read more >
Solved: Error with python script to fetch devices from NSO
As i am a python padawan, i can not even understand the errors returned ... line 137, in __exit__ self.gen.throw(typ, value, traceback) File...
Read more >
Error with HDF5 file - Google Groups
**ERROR**: HDF5 file descriptor is no instance of h5py. ... File "./psd.py", line 344, in <module> log = hoomd.hdf5.log('log.h5', quantities=['my_quantity', ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found