outputs :
pytest 4.6.11
python -X faulthandler -m pytest -s tmp.py
python -X faulthandler -m pytest -s tmp.py
Test session starts (platform: win32, Python 3.7.4, pytest 4.6.11, pytest-sugar 0.9.3)
rootdir: C:SnapsSnapDevswtoolssoftmytmptestDir
plugins: cov-2.6.1, html-2.1.1, metadata-1.8.0, modal-3.0, steps-1.7.3, sugar-0.9.3
collecting ... Windows fatal exception: access violation
Current thread 0x00017410 (most recent call first):
File "C:SnapsSnapDevswtoolssoftmytmptestDirtmp.py", line 13 in test_function
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestpython.py", line 174 in pytest_pyfunc_call
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestpython.py", line 1464 in runtest
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 123 in pytest_runtest_call
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 198 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 226 in from_call
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 198 in call_runtest_hook
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 173 in call_and_report
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 93 in runtestprotocol
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 78 in pytest_runtest_protocol
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 271 in pytest_runtestloop
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 250 in _main
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 206 in wrap_session
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 243 in pytest_cmdline_main
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestconfig__init__.py", line 84 in main
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespytest.py", line 102 in <module>
File "C:Python37-32Librunpy.py", line 85 in _run_code
File "C:Python37-32Librunpy.py", line 193 in _run_module_as_main
tmp.py ✓ 100% ██████████
Results (0.61s):
1 passed
pytest 5.4.3
python -X faulthandler -m pytest -p no:faulthandler -s tmp.py
python -X faulthandler -m pytest -p no:faulthandler -s tmp.py
Test session starts (platform: win32, Python 3.7.4, pytest 5.4.3, pytest-sugar 0.9.3)
rootdir: C:SnapsSnapDevswtoolssoftmytmptestDir
plugins: cov-2.6.1, html-2.1.1, metadata-1.8.0, modal-3.0, steps-1.7.3, sugar-0.9.3
collecting ... Windows fatal exception: access violation
Current thread 0x00018740 (most recent call first):
File "C:SnapsSnapDevswtoolssoftmytmptestDirtmp.py", line 13 in test_function
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestpython.py", line 182 in pytest_pyfunc_call
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestpython.py", line 1477 in runtest
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 135 in pytest_runtest_call
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 217 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 244 in from_call
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 217 in call_runtest_hook
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 186 in call_and_report
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 100 in runtestprotocol
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestrunner.py", line 85 in pytest_runtest_protocol
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 272 in pytest_runtestloop
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 247 in _main
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 191 in wrap_session
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestmain.py", line 240 in pytest_cmdline_main
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggycallers.py", line 187 in _multicall
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 87 in <lambda>
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggymanager.py", line 93 in _hookexec
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespluggyhooks.py", line 286 in __call__
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packages_pytestconfig__init__.py", line 125 in main
File "C:UsersPublicEnvsPyTATenv_v2.2.0libsite-packagespytest__main__.py", line 7 in <module>
File "C:Python37-32Librunpy.py", line 85 in _run_code
File "C:Python37-32Librunpy.py", line 193 in _run_module_as_main
tmp.py ✓ 100% ██████████
Results (0.57s):
1 passed
pytest 5.4.3
pytest -p no:faulthandler tmp.py
pytest -p no:faulthandler tmp.py
Test session starts (platform: win32, Python 3.7.4, pytest 5.4.3, pytest-sugar 0.9.3)
rootdir: C:SnapsSnapDevswtoolssoftmytmptestDir
plugins: cov-2.6.1, html-2.1.1, metadata-1.8.0, modal-3.0, steps-1.7.3, sugar-0.9.3
collecting ...
tmp.py ✓ 100% ██████████
Results (0.55s):
1 passed
So yeah… that seems conclusive, I will happily settle with saying the issue is in the DLL, and that pytest actually suffered no regression (on the contrary).
Short Description
I’m using PyCharm and am writing a pytest unit test.
I can run the test normally but if I try to debug it the debugger crashes.
Windows fatal exception: access violation
Stack Trace:
Thread 0x00003588 (most recent call first):
File «C:UsersMyUserNameAppDataLocalProgramsPythonPython310libthreading.py», line 324 in wait
File «C:UsersMyUserNameAppDataLocalProgramsPythonPython310libthreading.py», line 600 in wait
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydevpydevd.py», line 150 in _on_run
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydev_pydevd_bundlepydevd_comm.py», line 218 in run
File «C:UsersMyUserNameAppDataLocalProgramsPythonPython310libthreading.py», line 1009 in _bootstrap_inner
File «C:UsersMyUserNameAppDataLocalProgramsPythonPython310libthreading.py», line 966 in _bootstrap
Thread 0x000023f0 (most recent call first):
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydev_pydevd_bundlepydevd_comm.py», line 292 in _on_run
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydev_pydevd_bundlepydevd_comm.py», line 218 in run
File «C:UsersMyUserNameAppDataLocalProgramsPythonPython310libthreading.py», line 1009 in _bootstrap_inner
File «C:UsersMyUserNameAppDataLocalProgramsPythonPython310libthreading.py», line 966 in _bootstrap
…
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydev_pydev_imps_pydev_execfile.py», line 18 in execfile
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydevpydevd.py», line 1483 in _exec
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydevpydevd.py», line 1476 in run
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydevpydevd.py», line 2164 in main
File «C:Program FilesJetBrainsPyCharm 2021.1pluginspythonhelperspydevpydevd.py», line 2173 in
Process finished with exit code -1073741819 (0xC0000005)
Issue
I’m using pytest to run some tests for my project. Sometimes (about 30 to 50%) I get an error after the test finished. But this is preventing the testengine to create the testreport, which is really a pain.
Error:
Windows fatal exception: access violation
Current thread 0x000019e0 (most recent call first):
File "C:Python38libthreading.py", line 1200 in invoke_excepthook
File "C:Python38libthreading.py", line 934 in _bootstrap_inner
File "C:Python38libthreading.py", line 890 in _bootstrap
Thread 0x00001b0c (most recent call first):
File "C:Python38libsite-packagesserialserialwin32.py", line 240 in _close
File "C:Python38libsite-packagesserialserialwin32.py", line 246 in close
File "C:NoBackupsvntest_system_smets2pyetspluginsplugin_zigbee_dongle.py", line 141 in disconnect
File "C:NoBackupsvntest_system_smets2pyetspluginsplugin_zigbee_dongle.py", line 232 in stop
File "C:NoBackupsvntest_system_smets2pyetstestengineplugin_manager.py", line 286 in stop
File "C:NoBackupsvntest_system_smets2pyetstestenginetestengine.py", line 112 in session_finalize
File "C:NoBackupsvntest_system_smets2pyetstestenginepytest_test_engine.py", line 58 in test_engine
File "C:Python38libsite-packages_pytestfixtures.py", line 800 in _teardown_yield_fixture
File "C:Python38libsite-packages_pytestfixtures.py", line 871 in finish
File "C:Python38libsite-packages_pytestrunner.py", line 318 in _callfinalizers
File "C:Python38libsite-packages_pytestrunner.py", line 328 in _teardown_with_finalization
File "C:Python38libsite-packages_pytestrunner.py", line 310 in _pop_and_teardown
File "C:Python38libsite-packages_pytestrunner.py", line 350 in _teardown_towards
File "C:Python38libsite-packages_pytestrunner.py", line 342 in teardown_exact
File "C:Python38libsite-packages_pytestrunner.py", line 148 in pytest_runtest_teardown
File "C:Python38libsite-packagespluggycallers.py", line 187 in _multicall
File "C:Python38libsite-packagespluggymanager.py", line 83 in <lambda>
File "C:Python38libsite-packagespluggymanager.py", line 92 in _hookexec
File "C:Python38libsite-packagespluggyhooks.py", line 286 in __call__
File "C:Python38libsite-packages_pytestrunner.py", line 217 in <lambda>
File "C:Python38libsite-packages_pytestrunner.py", line 244 in from_call
File "C:Python38libsite-packages_pytestrunner.py", line 216 in call_runtest_hook
File "C:Python38libsite-packages_pytestrunner.py", line 186 in call_and_report
File "C:Python38libsite-packages_pytestrunner.py", line 101 in runtestprotocol
File "C:Python38libsite-packages_pytestrunner.py", line 85 in pytest_runtest_protocol
File "C:Python38libsite-packagespluggycallers.py", line 187 in _multicall
File "C:Python38libsite-packagespluggymanager.py", line 83 in <lambda>
File "C:Python38libsite-packagespluggymanager.py", line 92 in _hookexec
File "C:Python38libsite-packagespluggyhooks.py", line 286 in __call__
File "C:Python38libsite-packages_pytestmain.py", line 272 in pytest_runtestloop
File "C:Python38libsite-packagespluggycallers.py", line 187 in _multicall
File "C:Python38libsite-packagespluggymanager.py", line 83 in <lambda>
File "C:Python38libsite-packagespluggymanager.py", line 92 in _hookexec
File "C:Python38libsite-packagespluggyhooks.py", line 286 in __call__
File "C:Python38libsite-packages_pytestmain.py", line 247 in _main
File "C:Python38libsite-packages_pytestmain.py", line 191 in wrap_session
File "C:Python38libsite-packages_pytestmain.py", line 240 in pytest_cmdline_main
File "C:Python38libsite-packagespluggycallers.py", line 187 in _multicall
File "C:Python38libsite-packagespluggymanager.py", line 83 in <lambda>
File "C:Python38libsite-packagespluggymanager.py", line 92 in _hookexec
File "C:Python38libsite-packagespluggyhooks.py", line 286 in __call__
File "C:Python38libsite-packages_pytestconfig__init__.py", line 124 in main
File "testrun.py", line 1184 in run_single_test
File "testrun.py", line 1548 in main
File "testrun.py", line 1581 in <module>
Has somebody any idea how to fix or debug that?
I’m using pytest 5.4.1 with python 3.8.0 on win10. But this is also reproducable with older pytest versions.
The plugin plugin_zigbee_dongle.py uses pyserial (3.4) to communicate with an usb-rf-dongle in a thread. The following code is a snippet of this plugin:
import serial
import threading
class ZigbeeDongleSerial(object):
def __init__(self, test_engine):
self.ser = serial.Serial()
self.test_engine = test_engine
# ----------------------------------------------------------
def connect(self,
port,
baud,
timeout):
self.ser.baudrate = baud
self.ser.timeout = timeout
self.ser.port = port
self.ser.open()
# ----------------------------------------------------------
def disconnect(self):
try:
if self.is_connected():
self.ser.close() # <------- This is line 141 ----------
except:
pass
# ----------------------------------------------------------
# ----------------------------------------------------------
class PluginZigbeeDongle(PluginBase):
# ----------------------------------------------------------
def __init__(self, test_engine):
super(PluginZigbeeDongle, self).__init__()
self.test_engine = test_engine
self.dongle_serial = ZigbeeDongleSerial(self.test_engine)
self._startup_lock = threading.Lock()
self._startup_lock.acquire()
self.reader_thread = threading.Thread(target=self._read_worker, name="ZigbeeDongleThread")
# ----------------------------------------------------------
def start(self):
super(PluginZigbeeDongle, self).start()
# connect the serial port
self.dongle_serial.connect()
# start the reader thread
if self.dongle_serial.is_connected():
self.reader_thread.start()
# ----------------------------------------------------------
def stop(self):
super(PluginZigbeeDongle, self).stop()
# disconnect the serial port
if self.dongle_serial.is_connected():
self.dongle_serial.disconnect() # <------- This is line 232 ----------
# stop the reader thread
if self.reader_thread.is_alive():
self.reader_thread.join()
# ----------------------------------------------------------
def _read_worker(self):
# start-up is now complete
self._startup_lock.release()
# handle the incoming character stream
done = False
while not done:
try:
c = self.dongle_serial.read_byte()
except serial.SerialException:
done = True
except AttributeError:
done = True
if not done:
self._read_parser(c)
Solution
Downgrading pyserial from Version 3.4 to Version 2.7 fixed the problem
Answered By – Tobias M.
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0
Thread Rating:
- 0 Vote(s) — 0 Average
- 1
- 2
- 3
- 4
- 5
Windows fatal exception: access violation |
Posts: 1 Threads: 1 Joined: Mar 2020 Reputation: Mar-11-2020, 01:53 AM import pytest from pywinauto.application import Application def test_case(): assert True This is my script.
I just wonder how that fatal exception occurs and how we can fix it. |
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Handling Python Fatal Error | richajain1785 | 7 | 3,614 |
Oct-14-2021, 01:34 PM Last Post: Tails86 |
|
Fatal error after trying to play sound. | giladal | 0 | 1,376 |
Oct-22-2020, 10:27 AM Last Post: giladal |
|
Need to access Windows Machine or Personal Certificate Store and send to web app | seswho | 0 | 1,178 |
Sep-14-2020, 04:57 PM Last Post: seswho |
|
Fatal python error, need help | ryanmagid | 0 | 1,814 |
Aug-09-2020, 05:51 PM Last Post: ryanmagid |
|
Erreur Code access violation reading 0x00000004 | yan_mhb | 0 | 1,838 |
Jul-10-2020, 02:28 PM Last Post: yan_mhb |
|
appear fatal error popup for Python 2.7, what to do to Not appear again…? | lsepolis123 | 1 | 1,606 |
Mar-23-2020, 10:44 PM Last Post: lsepolis123 |
|
Has anyone experience a winError[5] Access Denied in Windows 10? | fstkmaro | 2 | 10,696 |
Nov-11-2019, 02:38 PM Last Post: fstkmaro |
|
Fatal error in launcher: Unable to create process using ‘»‘ | rsmldmv | 0 | 4,886 |
May-13-2019, 01:34 AM Last Post: rsmldmv |
|
Fatal Error in Python | MrRobot | 6 | 4,760 |
Feb-14-2019, 04:56 AM Last Post: MrRobot |
|
During handling of the above exception, another exception occurred | Skaperen | 7 | 24,367 |
Dec-21-2018, 10:58 AM Last Post: Gribouillis |
Users browsing this thread: 1 Guest(s)
- View a Printable Version
the full error is:
Windows fatal exception: access violation
Current thread 0x0000160c (most recent call first):
File "E:mlprojectsface swapNew folderapp.py", line 36 in <module>
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 1272 in _execute_prepared_user_code
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 1200 in wrapper
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 1213 in wrapper
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 1259 in execute_source
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 815 in _execute_source
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 801 in _execute_file
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 403 in _cmd_Run
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 204 in handle_command
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend.py", line 146 in mainloop
File "C:UsersUSERAppDataLocalProgramsThonnylibsite-packagesthonnybackend_launcher.py", line 87 in <module>
Windows fatal exception: access violation
The Source code is:
import cv2
# used for accessing url to download files
import urllib.request as urlreq
# used to access local directory
import os
# used to plot our images
pic = "dataset/face.jpg"
# read image with openCV
image = cv2.imread(pic)
# plot image with matplotlib package
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
image_gray = cv2.cvtColor(image_rgb, cv2.COLOR_BGR2GRAY)
haarcascade = "dataset/cascade.xml"
detector = cv2.CascadeClassifier(haarcascade)
faces = detector.detectMultiScale(image_gray)
for face in faces:
# save the coordinates in x, y, w, d variables
(x,y,w,d) = face
# Draw a white coloured rectangle around each face using the face's coordinates
# on the "image_template" with the thickness of 2
cv2.rectangle(image_rgb,(x,y),(x+w, y+d),(255, 255, 255), 2)
#cv2.imshow('Image',image_rgb)
#cv2.waitKey(0)
#cv2.destoyAllWindows()
LBFmodel = "dataset/lbfmodel.yaml"
landmark_detector = cv2.face.createFacemarkLBF()
landmark_detector.loadModel(LBFmodel)
_, landmarks = landmark_detector.fit(image_gray, faces)
It is a simple Face detector app in OpenCV but I wanter to add Facial landmark mark detection in this…
everything works fine until I add the last three lines of code which crashes the whole app
Also, I am using python 3.6.7 and purposefully downgraded the version of opencv to 3.4.6.
Содержание
- «Windows fatal exception: access violation» when calling decimate #229
- Comments
- nidu commented Aug 11, 2020 •
- Description
- Example Data
- banesullivan commented Aug 13, 2020 •
- banesullivan commented Aug 13, 2020
- nidu commented Aug 14, 2020 •
- nidu commented Aug 22, 2020
- nidu commented Aug 22, 2020
- akaszynski commented Aug 23, 2020
- nidu commented Aug 23, 2020
- Tensorflow train.py throws Windows fatal exception
- Windows fatal exception: access violation error (generate_tfrecord.py ) #7522
- Comments
- beyzanurkaya commented Sep 1, 2019
- tensorflowbutler commented Sep 2, 2019
- beyzanurkaya commented Sep 2, 2019
- From tensorflow/models/
- Create train data:
- Create test data:
- TO-DO replace this with label map
- Training object detection with model_main.py fails with Windows fatal exception: access violation
- FIX: Exception Access Violation Error on Windows 10
- How can I fix the Exception Access Violation error?
- 1. Check your PC for malware
- BullGuard
- 2. Add Data Execution Prevention Exception
- 3. Disable User Account Control
- 4. Create options.ini file
- 5. Make sure that the file isn’t set as read-only
- 6. Reconnect your headset
- 7. Check for hardware problems
- 7. Use the Compatibility mode
- 8. Run the Hardware troubleshooter
- 9. Reinstall the application
«Windows fatal exception: access violation» when calling decimate #229
Description
Example Data
I can reproduce it with this file:
The text was updated successfully, but these errors were encountered:
This seems related to pyvista/pyvista#861. @pyvista/developers, this is concerning that we’ve had two Windows users recently report the Windows fatal exception: access violation error.
@nidu, can you please share a PyVista report (you shared a scooby default report which doesn’t show details about PyVista)? print(pv.Report(gpu=False)) ( gpu=False to avoid any errors)
My immediate advice, I suspect you are using the latest version of VTK (9.x). Please try downgrading VTK to 8.1.2 and see if the error happens still
Here’s the info from pv.Report(gpu=False)
Hi, small update. I could set up WSL 2 on my machine, installed pyvista there, but i get similar error with the example above, so probably it’s not Windows specific (if WSL 2 is a good enough approximation to Linux).
And indeed this simple piece of code works fine:
but this one crashes with access violation (notice one more face)
Thanks for looking into this @nidu! Many of the pyvista developers/maintainers have been busy with our day jobs, so sorry for the late follow-up.
It appears that running clean fixeds this sort of problem:
We can consider adding a note to decimate indicating that segmentation faults can be prevented by running clean beforehand. I’m hesitant to run clean always since it can take a long time to execute.
@akaszynski thanks, clean is much cleaner than what i came up with!
Источник
Tensorflow train.py throws Windows fatal exception
I’ve been working with Tensorflow for quite a while now, had some issues, but they never remained unresolved. Today i wanted to train a new model, when things got interesting. At first, the training stopped after one step without any reason. It happend before, opening a new cmd window solved it. Not this time tough. After i tried again, train.py started to throw this:
Windows fatal exception: access violation
Current thread 0x000018d4 (most recent call first):
File «C:windowssystem32venvlibsite-packagestensorflowpythonlibiofile_io.py», line 84 in _preread_check File «C:windowssystem32venvlibsite-packagestensorflowpythonlibiofile_io.py», line 122 in read File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectionutilslabel_map_util.py», line 133 in load_labelmap File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectionutilslabel_map_util.py», line 164 in get_label_map_dict File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectiondata_decoderstf_example_decoder.py», line 59 in init File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectiondata_decoderstf_example_decoder.py», line 314 in init File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectionbuildersdataset_builder.py», line 130 in build File «train.py», line 121 in get_next File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectionlegacytrainer.py», line 59 in create_input_queue File «C:UsersxxsourceTensorFlowmodelsresearchobject_detectionlegacytrainer.py», line 280 in train File «train.py», line 180 in main File «C:windowssystem32venvlibsite-packagestensorflowpythonutildeprecation.py», line 324 in new_func File «C:Program Files (x86)Microsoft Visual StudioSharedPython37_64libsite-packagesabslapp.py», line 251 in _run_main File «C:Program Files (x86)Microsoft Visual StudioSharedPython37_64libsite-packagesabslapp.py», line 300 in run File «C:windowssystem32venvlibsite-packagestensorflowpythonplatformapp.py», line 40 in run File «train.py», line 184 in
Last time i saw this issue, it was because i was using data downloaded from the internet, and there was one particular picture that TF did not like, but removing that one from the dataset solved the issue. I was wondering if this was the case, but no. I couldnt start it with previously tried datasets either. i decided to reinstall tensorflow, set up a new virtual environment, but still nothing. Been looking for hours what the problem could be, both on the internet, and on my own trying different things, but nothing worked, same exception each time. Did anybody encounter anything similar?
Источник
Windows fatal exception: access violation error (generate_tfrecord.py ) #7522
Hi all I need your help a lot. I’ve been dealing with this problem for about 3 days. Moreover, I have to solve this problem in 1-2 days at the latest.
Windows fatal exception: access violation
Current thread 0x00000708 (most recent call first):
File «C:UsersotobilAnaconda3envsRobotaksiTespitlibsite-packagestensorflowpythonlibiofile_io.py», line 84 in _preread_check
File «C:UsersotobilAnaconda3envsRobotaksiTespitlibsite-packagestensorflowpythonlibiofile_io.py», line 122 in read
File «generate_tfrecord.py», line 78 in create_tf_example
File «generate_tfrecord.py», line 123 in main
File «C:UsersotobilAnaconda3envsRobotaksiTespitlibsite-packagesabslapp.py», line 250 in _run_main
File «C:UsersotobilAnaconda3envsRobotaksiTespitlibsite-packagesabslapp.py», line 299 in run
File «C:UsersotobilAnaconda3envsRobotaksiTespitlibsite-packagestensorflowpythonplatformapp.py», line 40 in run
File «generate_tfrecord.py», line 132 in
data size in my train folder : 151 GB
the size of created record file: 22,8 GB
in summary, the record file is a bit generated, and then the error occurs and the record file does not occur in full size
system:
Windows10
Intel Coffee Lake Core i7-9700K
8GB GDDR6 Nvidia RTX2070 256 Bit
16GB (2x8GB) DDR4 2666MHz
The text was updated successfully, but these errors were encountered:
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
What is the top-level directory of the model you are using
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce
thanks for your reply.
python setup.py build
python setup.py install
From tensorflow/models/
Create train data:
Create test data:
import os
import io
import pandas as pd
import tensorflow as tf
from PIL import Image
from object_detection.utils import dataset_util
from collections import namedtuple, OrderedDict
flags = tf.app.flags
flags.DEFINE_string(‘csv_input’, », ‘Path to the CSV input’)
flags.DEFINE_string(‘image_dir’, », ‘Path to the image directory’)
flags.DEFINE_string(‘output_path’, », ‘Path to output TFRecord’)
FLAGS = flags.FLAGS
TO-DO replace this with label map
def class_text_to_int(row_label):
if row_label == ‘dur’:
return 1
elif row_label == ‘durak’:
return 2
elif row_label == ‘girilmez’:
return 3
elif row_label == ‘hiz_otuz’:
return 4
elif row_label == ‘hiz_yirmi’:
return 5
elif row_label == ‘hiz_yirmi_son’:
return 6
elif row_label == ‘ileri_ve_saga_mecburi’:
return 7
elif row_label == ‘ileri_ve_sola_mecburi’:
return 8
elif row_label == ‘ileriden_sag’:
return 9
elif row_label == ‘ileriden_sol’:
return 10
elif row_label == ‘kirmizi’:
return 11
elif row_label == ‘park’:
return 12
elif row_label == ‘park_yasak’:
return 13
elif row_label == ‘sag_yasak’:
return 14
elif row_label == ‘sol_yasak’:
return 15
elif row_label == ‘trafige_kapali’:
return 16
elif row_label == ‘yesil’:
return 17
else:
None
def split(df, group):
data = namedtuple(‘data’, [‘filename’, ‘object’])
gb = df.groupby(group)
return [data(filename, gb.get_group(x)) for filename, x in zip(gb.groups.keys(), gb.groups)]
def create_tf_example(group, path):
with tf.gfile.GFile(os.path.join(path, ‘<>‘.format(group.filename)), ‘rb’) as fid:
encoded_jpg = fid.read()
encoded_jpg_io = io.BytesIO(encoded_jpg)
image = Image.open(encoded_jpg_io)
width, height = image.size
def main(_):
writer = tf.python_io.TFRecordWriter(FLAGS.output_path)
path = os.path.join(os.getcwd(), FLAGS.image_dir)
examples = pd.read_csv(FLAGS.csv_input)
grouped = split(examples, ‘filename’)
for group in grouped:
tf_example = create_tf_example(group, path)
writer.write(tf_example.SerializeToString())
if name == ‘main‘:
tf.app.run()
CUDA 10.0
CUDNN 7.4.2 for CUDA tool kit 10.0
Windows 10 Pro
Intel Coffee Lake Core i7-9700K
8GB GDDR6 Nvidia RTX2070 256 Bit
RAM: 16GB
Источник
Training object detection with model_main.py fails with Windows fatal exception: access violation
I am trying to train an object detection model with model_main.py file. I can train this on ubuntu environment without any problem, but now moved to win 10 (because I have in that PC a GeForece 1080Ti) and now I have trouble. Training can start and does pretty well until the first checkpoint where I get these errors (also I can restart and it continous training from last checkpoint, but fails again after saving the next. ):
INFO:tensorflow:Saving checkpoints for 46040 into trainingmodel.ckpt. I0307 10:01:21.055022 8112 basic_session_run_hooks.py:606] Saving checkpoints for 46040 into trainingmodel.ckpt. WARNING:tensorflow:From C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingsaver.py:960: remove_checkpoint (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to delete files with this prefix. W0307 10:01:22.363223 8112 deprecation.py:323] From C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingsaver.py:960: remove_checkpoint (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to delete files with this prefix. Windows fatal exception: access violation
Thread 0x000023b4 (most recent call first): File «C:UsersZsetszko21Anaconda3envstf_env_Tilibthreading.py», line 296 in wait File «C:UsersZsetszko21Anaconda3envstf_env_Tilibqueue.py», line 170 in get File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythonsummarywriterevent_file_writer.py», line 159 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibthreading.py», line 926 in _bootstrap_inner File «C:UsersZsetszko21Anaconda3envstf_env_Tilibthreading.py», line 890 in _bootstrap
Current thread 0x00001fb0 (most recent call first): File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythonlibiofile_io.py», line 84 in _preread_check File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythonlibiofile_io.py», line 122 in read File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectionutilslabel_map_util.py», line 139 in load_labelmap File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectionutilslabel_map_util.py», line 172 in get_label_map_dict File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectiondata_decoderstf_example_decoder.py», line 64 in init File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectiondata_decoderstf_example_decoder.py», line 319 in init File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectionbuildersdataset_builder.py», line 130 in build File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectioninputs.py», line 725 in eval_input File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesobject_detection-0.1-py3.7.eggobject_detectioninputs.py», line 625 in _eval_input_fn File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1113 in _call_input_fn File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1022 in _get_features_and_labels_from_input_fn File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1534 in _call_model_fn_eval File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1501 in _evaluate_build_graph File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 501 in _evaluate File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 519 in _actual_eval File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 477 in evaluate File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatortraining.py», line 920 in evaluate_and_export File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatortraining.py», line 539 in _evaluate File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatortraining.py», line 519 in after_save File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingbasic_session_run_hooks.py», line 619 in _save File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingbasic_session_run_hooks.py», line 594 in after_run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingmonitored_session.py», line 1419 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingmonitored_session.py», line 1338 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingmonitored_session.py», line 1252 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythontrainingmonitored_session.py», line 754 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1484 in _train_with_estimator_spec File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1192 in _train_model_default File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 1158 in _train_model File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatorestimator.py», line 367 in train File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatortraining.py», line 714 in run_local File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatortraining.py», line 613 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflow_estimatorpythonestimatortraining.py», line 473 in train_and_evaluate File «model_main.py», line 109 in main File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesabslapp.py», line 250 in _run_main File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagesabslapp.py», line 299 in run File «C:UsersZsetszko21Anaconda3envstf_env_Tilibsite-packagestensorflowpythonplatformapp.py», line 40 in run File «model_main.py», line 113 in (tf_env_Ti) PS A:PPEVisiontrainermodels-masterresearchobject_detection>
I also added these lines to prevent any OOM to model_main.py:
Win10 Geforce GTX 1080Ti 11Gb 32Gb RAM i5-7500 3Ghz CPU Tensorflow 1.14-gpu created with conda env +——————————————————————————+ | NVIDIA-SMI 442.50 Driver Version: 442.50 CUDA Version: 10.2 | |——————————-+———————-+———————-+ | GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 108. WDDM | 00000000:01:00.0 On | N/A | | 23% 36C P8 13W / 250W | 449MiB / 11264MiB | 0% Default | +——————————-+———————-+———————-+
Источник
FIX: Exception Access Violation Error on Windows 10
So, what is Exception access violation error and how to fix it? According to the reports, Exception access violation error is usually related to a memory error.
It’s mostly caused by software, but sometimes this error can be caused by a faulty RAM module.
Exception Access Violation error can be problematic, and speaking of errors, users reported the following error messages on their PC:
How can I fix the Exception Access Violation error?
1. Check your PC for malware
According to users, sometimes this error can appear due to malware infections. Many of them reported a fake Chromium browser on their PC that causes this error to appear.
Therefore, it’s advised to perform a detailed scan with your antivirus software. If your current antivirus can’t find and fix the problem, we strongly recommend that you try another solution.
In search for the right antivirus for your system, you should look for the one that has a minimal impact on the system, identity safety features, and strong virus protection.
BullGuard
BullGuard is a one-stop solution to scan for malware. No Exception Access Violation errors will bother you again!
2. Add Data Execution Prevention Exception
If a specific program is giving you an Exception access violation error, you might want to add that program to the Data Execution Prevention exceptions list. To do that follow the steps above.
Once you add the desired application to the exclusion list, check if the problem is resolved.
3. Disable User Account Control
It has been reported that Exception access violation error occurs when users are trying to install Java or when they try to run Java applets or applications.
In order to fix this issue, it’s advised to temporarily disable User Account Control. To do that, follow the instructions above.
This solution applies to other software as well, so even if Java is working without any problems on your computer, you can try disabling User Account Control to fix this issue.
We have to mention that disabling User Account Control comes with slight security risk, so if you’re not comfortable with it, just disable User Account Control when you run the desired application and then turn it back on.
4. Create options.ini file
As we already mentioned, the Exception access violation error affects all sorts of software, and video games aren’t an exception.
One game affected by this issue is Lord of The Rings: Battle for Middle Earth, but fortunately for you, there’s a solution available.
Keep in mind that this solution works only for Lord of The Rings: Battle for Middle Earth, however, you can change the configuration file for most games by following similar steps.
5. Make sure that the file isn’t set as read-only
Sometimes Exception access violation error can appear because your files are set to read-only mode. However, you can change that by following the above steps.
This is a simple solution and several users reported that it works, so feel free to try it out.
Expert Tip: Some PC issues are hard to tackle, especially when it comes to corrupted repositories or missing Windows files. If you are having troubles fixing an error, your system may be partially broken. We recommend installing Restoro, a tool that will scan your machine and identify what the fault is.
Click here to download and start repairing.
6. Reconnect your headset
This error has been reported by Vindictus players, and according to them, this error occurs with Logitech headset G35, but the issue might be related to other headsets from other manufacturers as well.
According to users, the only solution is to unplug your headset while the game is loading and plug it back in once the game has loaded.
Also, if you find out that the problem was caused by the headphones, you can find a better pair in our list with the best headphones.
7. Check for hardware problems
As we already mentioned Exception access violation error can sometimes be related to your RAM memory, so it won’t hurt to check if your RAM memory is working properly.
You can check your memory using MemTest86. Just download it, and move it to a USB flash drive, restart your computer and let MemTest86 run for a while.
If you don’t know how to do it, maybe it’s best that you contact a professional and ask him to do it for you.
Many users reported that their RAM was the cause of this error, so be sure to check your RAM and replace it if you find any problems with it.
You can also find more about your PC components with the software from this convenient list.
7. Use the Compatibility mode
If you’re getting Exception Access Violation error message frequently on your PC, that can be due to compatibility issues. Certain older applications aren’t fully compatible with Windows 10.
Fortunately, Windows has a useful feature called Compatibility mode that allows you to run older applications. If you have this problem with a certain application, simply enable Compatibility mode.
Once you make the necessary changes, try starting the application again and check if the error reappears.
Keep in mind that you might have to try several different compatibility modes before you find the one that works on your PC.
8. Run the Hardware troubleshooter
According to users, you might be able to fix this problem simply by running the Hardware troubleshooter.
This feature is designed to fix common hardware problems, and it might help you with Exception Access Violation error.
Once the troubleshooter is finished, check if the problem still appears. Few users reported that this solution worked for them, so feel free to try it out.
9. Reinstall the application
If you’re getting Exception Access Violation while trying to run a certain application, you might be able to fix the problem simply by reinstalling that application.
Simply remove the problematic application from your PC and install it again. If possible, try to download and install the latest version and check if that solves the problem.
Exception Access Violation error can cause certain problems on your PC, but we hope you managed to solve this issue by using one of our solutions.
Restoro has been downloaded by 0 readers this month.
Источник