Windows fatal exception access violation python

Discussions on Python.org

Loading

thanks for your reply.

steps:

conda create -n RobotaksiTespit pip python=3.6
conda activate RobotaksiTespit
pip install —upgrade tensorflow-gpu
pip install «numpy<1.17»
conda install -c anaconda protobuf
pip install pillow
pip install lxml
pip install jupyter
pip install matplotlib
pip install pandas
pip install opencv-python
D:
set PYTHONPATH=D:\RobotaksiTespit\model;D:\RobotaksiTespit\model\research;D:\RobotaksiTespit\model\research\slim

(RobotaksiTespit) D:>cd RobotaksiTespit\model\research

protoc —python_out=. .\object_detection\protos\anchor_generator.proto .\object_detection\protos\argmax_matcher.proto .\object_detection\protos\bipartite_matcher.proto .\object_detection\protos\box_coder.proto .\object_detection\protos\box_predictor.proto .\object_detection\protos\eval.proto .\object_detection\protos\faster_rcnn.proto .\object_detection\protos\faster_rcnn_box_coder.proto .\object_detection\protos\grid_anchor_generator.proto .\object_detection\protos\hyperparams.proto .\object_detection\protos\image_resizer.proto .\object_detection\protos\input_reader.proto .\object_detection\protos\losses.proto .\object_detection\protos\matcher.proto .\object_detection\protos\mean_stddev_box_coder.proto .\object_detection\protos\model.proto .\object_detection\protos\optimizer.proto .\object_detection\protos\pipeline.proto .\object_detection\protos\post_processing.proto .\object_detection\protos\preprocessor.proto .\object_detection\protos\region_similarity_calculator.proto .\object_detection\protos\square_box_coder.proto .\object_detection\protos\ssd.proto .\object_detection\protos\ssd_anchor_generator.proto .\object_detection\protos\string_int_label_map.proto .\object_detection\protos\train.proto .\object_detection\protos\keypoint_box_coder.proto .\object_detection\protos\multiscale_anchor_generator.proto .\object_detection\protos\graph_rewriter.proto .\object_detection\protos\calibration.proto

python setup.py build

python setup.py install

cd object_detection

python xml_to_csv.py

python generate_tfrecord.py —csv_input=images\train_labels.csv —image_dir=images\train —output_path=train.record

«»»
Usage:

From tensorflow/models/

Create train data:

python generate_tfrecord.py —csv_input=images/train_labels.csv —image_dir=images/train —output_path=train.record

Create test data:

python generate_tfrecord.py —csv_input=images/test_labels.csv —image_dir=images/test —output_path=test.record
«»»
from future import division
from future import print_function
from future import absolute_import

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

generate_tfrecord.py

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

filename = group.filename.encode('utf8')
image_format = b'jpg'
xmins = []
xmaxs = []
ymins = []
ymaxs = []
classes_text = []
classes = []

for index, row in group.object.iterrows():
    xmins.append(row['xmin'] / width)
    xmaxs.append(row['xmax'] / width)
    ymins.append(row['ymin'] / height)
    ymaxs.append(row['ymax'] / height)
    classes_text.append(row['class'].encode('utf8'))
    classes.append(class_text_to_int(row['class']))

tf_example = tf.train.Example(features=tf.train.Features(feature={
    'image/height': dataset_util.int64_feature(height),
    'image/width': dataset_util.int64_feature(width),
    'image/filename': dataset_util.bytes_feature(filename),
    'image/source_id': dataset_util.bytes_feature(filename),
    'image/encoded': dataset_util.bytes_feature(encoded_jpg),
    'image/format': dataset_util.bytes_feature(image_format),
    'image/object/bbox/xmin': dataset_util.float_list_feature(xmins),
    'image/object/bbox/xmax': dataset_util.float_list_feature(xmaxs),
    'image/object/bbox/ymin': dataset_util.float_list_feature(ymins),
    'image/object/bbox/ymax': dataset_util.float_list_feature(ymaxs),
    'image/object/class/text': dataset_util.bytes_list_feature(classes_text),
    'image/object/class/label': dataset_util.int64_list_feature(classes),
}))
return tf_example

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())

writer.close()
output_path = os.path.join(os.getcwd(), FLAGS.output_path)
print('Successfully created the TFRecords: {}'.format(output_path))

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

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:\Python38\lib\threading.py", line 1200 in invoke_excepthook
  File "C:\Python38\lib\threading.py", line 934 in _bootstrap_inner
  File "C:\Python38\lib\threading.py", line 890 in _bootstrap

Thread 0x00001b0c (most recent call first):
  File "C:\Python38\lib\site-packages\serial\serialwin32.py", line 240 in _close
  File "C:\Python38\lib\site-packages\serial\serialwin32.py", line 246 in close
  File "C:\NoBackup\svn\test_system_smets2\pyets\plugins\plugin_zigbee_dongle.py", line 141 in disconnect
  File "C:\NoBackup\svn\test_system_smets2\pyets\plugins\plugin_zigbee_dongle.py", line 232 in stop
  File "C:\NoBackup\svn\test_system_smets2\pyets\testengine\plugin_manager.py", line 286 in stop
  File "C:\NoBackup\svn\test_system_smets2\pyets\testengine\testengine.py", line 112 in session_finalize
  File "C:\NoBackup\svn\test_system_smets2\pyets\testengine\pytest_test_engine.py", line 58 in test_engine
  File "C:\Python38\lib\site-packages\_pytest\fixtures.py", line 800 in _teardown_yield_fixture
  File "C:\Python38\lib\site-packages\_pytest\fixtures.py", line 871 in finish
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 318 in _callfinalizers
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 328 in _teardown_with_finalization
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 310 in _pop_and_teardown
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 350 in _teardown_towards
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 342 in teardown_exact
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 148 in pytest_runtest_teardown
  File "C:\Python38\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 83 in <lambda>
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 92 in _hookexec
  File "C:\Python38\lib\site-packages\pluggy\hooks.py", line 286 in __call__
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 217 in <lambda>
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 244 in from_call
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 216 in call_runtest_hook
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 186 in call_and_report
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 101 in runtestprotocol
  File "C:\Python38\lib\site-packages\_pytest\runner.py", line 85 in pytest_runtest_protocol
  File "C:\Python38\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 83 in <lambda>
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 92 in _hookexec
  File "C:\Python38\lib\site-packages\pluggy\hooks.py", line 286 in __call__
  File "C:\Python38\lib\site-packages\_pytest\main.py", line 272 in pytest_runtestloop
  File "C:\Python38\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 83 in <lambda>
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 92 in _hookexec
  File "C:\Python38\lib\site-packages\pluggy\hooks.py", line 286 in __call__
  File "C:\Python38\lib\site-packages\_pytest\main.py", line 247 in _main
  File "C:\Python38\lib\site-packages\_pytest\main.py", line 191 in wrap_session
  File "C:\Python38\lib\site-packages\_pytest\main.py", line 240 in pytest_cmdline_main
  File "C:\Python38\lib\site-packages\pluggy\callers.py", line 187 in _multicall
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 83 in <lambda>
  File "C:\Python38\lib\site-packages\pluggy\manager.py", line 92 in _hookexec
  File "C:\Python38\lib\site-packages\pluggy\hooks.py", line 286 in __call__
  File "C:\Python38\lib\site-packages\_pytest\config\__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)

Orekit

Loading

Most tensorboards don’t work for some reason! The solution in that case seems to be to reinstall tensorflow and tensorboard, but it still didn’t work, so it’s a memorandum.

Excerpt from Official issues.

Execution environment

Windows10
tensorflow-gpu==1.15
tensorboard==1.15

Execution command

When there are logs files in the same directory

tensorbord --logdir=./logs --host=127.0.0.1


 Run
 By the way, in my environment, it didn't work unless I specified host. (Refer to [this site](http://wshinya.hatenablog.com/entry/2018/10/04/112909) for host specification)

## solution
 Rename or delete checkpoint files in the same directory

## Digression
 This fixed it. Perhaps they collided with each other in a reference relationship.



  • Windows fastboot update rom bat
  • Windows failed to start a recent hardware or software change might be the cause 0xc0000098
  • Windows failed to start a recent hardware or software change might be the cause 0xc000000f
  • Windows fast mode что это
  • Windows expert bundle torproject org