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.

facerec_from_webcam_multiprocessing.py run Global is not defined

See original GitHub issue
  • face_recognition version: 1.23
  • Python version: 3.6.6
  • Operating System: windows 10

Description

image

What I Did

facerec_from_webcam_multiprocessing.py run Global is not defined. pls fix it, thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chn-lee-yumicommented, May 16, 2019

@sujoyu Thank you. Now I realized what’s wrong. Global is a global variable, but I don’t know why on some machines (maybe python version?) it works, but others will show name 'Global' is not defined.

@Muplex Pass the variable using function arg or just add global Global on the start of the functions (capture()andprocess()) may work. I will fix this soon.

0reactions
sujoyucommented, May 16, 2019

Hi Muplex. The fixed example is following link. https://gist.github.com/sujoyu/ad36b2fef0f0e215d6ee1d093d925e63 I’m not a Python expert too. It may not be a best way.

Additionally, in my low spec but 2 cores 4threads machine, following code is faster than the original.

Change line 125

worker_num = cpu_count()

to

worker_num = cpu_count() - 1

- 1 indicates count of capturing process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught ReferenceError: global is not defined #10035
Bug report I have an Electron based application. we do webpack in the render process. It throws error when I run the app...
Read more >
Jest: ReferenceError: global is not defined
this error removed the global issues, but gave me a new one in cannot use import statement outside a module off jest runtime....
Read more >
How to fix the ReferenceError: global is not defined error in ...
I spent hours trying to figure this out and it was really difficult to find the exact information on the web since this...
Read more >
Uncaught ReferenceError: global is not defined - YouTube
Uncaught ReferenceError: global is not defined at node_modules/@walletconnect/socket-transport/dist/esm/index.jscreate a n ew filw named ...
Read more >
index.js:43 uncaught referenceerror: global is not defined
js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following for the Reflect API. */ // import 'core-js/es6/reflect'; /**...
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