CUDA runtime implicit initialization on GPU:0 failed. Status: unknown error











up vote
0
down vote

favorite












For ImageDataGenerator using keras library i use the following code.Number of training set is 8000 and number of test set is 2000.



classifier.fit_generator(
generator = training_set,
steps_per_epoch=8000,
validation_data = test_set,
validation_steps = 2000,
epochs=25)


But when i run the code i get the following errors.Is there any problem in my tensorflow version or keras version? Currently i am using keras version = 2.2.4, python=3.6, tensorflow version = 1.11.



InternalError                             Traceback (most recent call last)
<ipython-input-88-16fbb44d18e3> in <module>()
4 validation_data = test_set,
5 validation_steps = 2000,
----> 6 epochs=25)

~Anaconda3libsite-packageskeraslegacyinterfaces.py in wrapper(*args, **kwargs)
89 warnings.warn('Update your `' + object_name + '` call to the ' +
90 'Keras 2 API: ' + signature, stacklevel=2)
---> 91 return func(*args, **kwargs)
92 wrapper._original_function = func
93 return wrapper

~Anaconda3libsite-packageskerasenginetraining.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
1416 use_multiprocessing=use_multiprocessing,
1417 shuffle=shuffle,
-> 1418 initial_epoch=initial_epoch)
1419
1420 @interfaces.legacy_generator_methods_support

~Anaconda3libsite-packageskerasenginetraining_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
215 outs = model.train_on_batch(x, y,
216 sample_weight=sample_weight,
--> 217 class_weight=class_weight)
218
219 outs = to_list(outs)

~Anaconda3libsite-packageskerasenginetraining.py in train_on_batch(self, x, y, sample_weight, class_weight)
1215 ins = x + y + sample_weights
1216 self._make_train_function()
-> 1217 outputs = self.train_function(ins)
1218 return unpack_singleton(outputs)
1219

~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in __call__(self, inputs)
2695
2696 def __call__(self, inputs):
-> 2697 if hasattr(get_session(), '_make_callable_from_options'):
2698 if py_any(is_sparse(x) for x in self.inputs):
2699 if py_any(is_tensor(x) for x in inputs):

~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in get_session()
184 config = tf.ConfigProto(intra_op_parallelism_threads=num_thread,
185 allow_soft_placement=True)
--> 186 _SESSION = tf.Session(config=config)
187 session = _SESSION
188 if not _MANUAL_VAR_INIT:

~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
1509
1510 """
-> 1511 super(Session, self).__init__(target, graph, config=config)
1512 # NOTE(mrry): Create these on first `__enter__` to avoid a reference cycle.
1513 self._default_graph_context_manager = None

~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
632 try:
633 # pylint: disable=protected-access
--> 634 self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
635 # pylint: enable=protected-access
636 finally:

InternalError: CUDA runtime implicit initialization on GPU:0 failed. Status: unknown error









share|improve this question


























    up vote
    0
    down vote

    favorite












    For ImageDataGenerator using keras library i use the following code.Number of training set is 8000 and number of test set is 2000.



    classifier.fit_generator(
    generator = training_set,
    steps_per_epoch=8000,
    validation_data = test_set,
    validation_steps = 2000,
    epochs=25)


    But when i run the code i get the following errors.Is there any problem in my tensorflow version or keras version? Currently i am using keras version = 2.2.4, python=3.6, tensorflow version = 1.11.



    InternalError                             Traceback (most recent call last)
    <ipython-input-88-16fbb44d18e3> in <module>()
    4 validation_data = test_set,
    5 validation_steps = 2000,
    ----> 6 epochs=25)

    ~Anaconda3libsite-packageskeraslegacyinterfaces.py in wrapper(*args, **kwargs)
    89 warnings.warn('Update your `' + object_name + '` call to the ' +
    90 'Keras 2 API: ' + signature, stacklevel=2)
    ---> 91 return func(*args, **kwargs)
    92 wrapper._original_function = func
    93 return wrapper

    ~Anaconda3libsite-packageskerasenginetraining.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
    1416 use_multiprocessing=use_multiprocessing,
    1417 shuffle=shuffle,
    -> 1418 initial_epoch=initial_epoch)
    1419
    1420 @interfaces.legacy_generator_methods_support

    ~Anaconda3libsite-packageskerasenginetraining_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
    215 outs = model.train_on_batch(x, y,
    216 sample_weight=sample_weight,
    --> 217 class_weight=class_weight)
    218
    219 outs = to_list(outs)

    ~Anaconda3libsite-packageskerasenginetraining.py in train_on_batch(self, x, y, sample_weight, class_weight)
    1215 ins = x + y + sample_weights
    1216 self._make_train_function()
    -> 1217 outputs = self.train_function(ins)
    1218 return unpack_singleton(outputs)
    1219

    ~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in __call__(self, inputs)
    2695
    2696 def __call__(self, inputs):
    -> 2697 if hasattr(get_session(), '_make_callable_from_options'):
    2698 if py_any(is_sparse(x) for x in self.inputs):
    2699 if py_any(is_tensor(x) for x in inputs):

    ~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in get_session()
    184 config = tf.ConfigProto(intra_op_parallelism_threads=num_thread,
    185 allow_soft_placement=True)
    --> 186 _SESSION = tf.Session(config=config)
    187 session = _SESSION
    188 if not _MANUAL_VAR_INIT:

    ~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
    1509
    1510 """
    -> 1511 super(Session, self).__init__(target, graph, config=config)
    1512 # NOTE(mrry): Create these on first `__enter__` to avoid a reference cycle.
    1513 self._default_graph_context_manager = None

    ~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
    632 try:
    633 # pylint: disable=protected-access
    --> 634 self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
    635 # pylint: enable=protected-access
    636 finally:

    InternalError: CUDA runtime implicit initialization on GPU:0 failed. Status: unknown error









    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      For ImageDataGenerator using keras library i use the following code.Number of training set is 8000 and number of test set is 2000.



      classifier.fit_generator(
      generator = training_set,
      steps_per_epoch=8000,
      validation_data = test_set,
      validation_steps = 2000,
      epochs=25)


      But when i run the code i get the following errors.Is there any problem in my tensorflow version or keras version? Currently i am using keras version = 2.2.4, python=3.6, tensorflow version = 1.11.



      InternalError                             Traceback (most recent call last)
      <ipython-input-88-16fbb44d18e3> in <module>()
      4 validation_data = test_set,
      5 validation_steps = 2000,
      ----> 6 epochs=25)

      ~Anaconda3libsite-packageskeraslegacyinterfaces.py in wrapper(*args, **kwargs)
      89 warnings.warn('Update your `' + object_name + '` call to the ' +
      90 'Keras 2 API: ' + signature, stacklevel=2)
      ---> 91 return func(*args, **kwargs)
      92 wrapper._original_function = func
      93 return wrapper

      ~Anaconda3libsite-packageskerasenginetraining.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
      1416 use_multiprocessing=use_multiprocessing,
      1417 shuffle=shuffle,
      -> 1418 initial_epoch=initial_epoch)
      1419
      1420 @interfaces.legacy_generator_methods_support

      ~Anaconda3libsite-packageskerasenginetraining_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
      215 outs = model.train_on_batch(x, y,
      216 sample_weight=sample_weight,
      --> 217 class_weight=class_weight)
      218
      219 outs = to_list(outs)

      ~Anaconda3libsite-packageskerasenginetraining.py in train_on_batch(self, x, y, sample_weight, class_weight)
      1215 ins = x + y + sample_weights
      1216 self._make_train_function()
      -> 1217 outputs = self.train_function(ins)
      1218 return unpack_singleton(outputs)
      1219

      ~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in __call__(self, inputs)
      2695
      2696 def __call__(self, inputs):
      -> 2697 if hasattr(get_session(), '_make_callable_from_options'):
      2698 if py_any(is_sparse(x) for x in self.inputs):
      2699 if py_any(is_tensor(x) for x in inputs):

      ~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in get_session()
      184 config = tf.ConfigProto(intra_op_parallelism_threads=num_thread,
      185 allow_soft_placement=True)
      --> 186 _SESSION = tf.Session(config=config)
      187 session = _SESSION
      188 if not _MANUAL_VAR_INIT:

      ~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
      1509
      1510 """
      -> 1511 super(Session, self).__init__(target, graph, config=config)
      1512 # NOTE(mrry): Create these on first `__enter__` to avoid a reference cycle.
      1513 self._default_graph_context_manager = None

      ~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
      632 try:
      633 # pylint: disable=protected-access
      --> 634 self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
      635 # pylint: enable=protected-access
      636 finally:

      InternalError: CUDA runtime implicit initialization on GPU:0 failed. Status: unknown error









      share|improve this question













      For ImageDataGenerator using keras library i use the following code.Number of training set is 8000 and number of test set is 2000.



      classifier.fit_generator(
      generator = training_set,
      steps_per_epoch=8000,
      validation_data = test_set,
      validation_steps = 2000,
      epochs=25)


      But when i run the code i get the following errors.Is there any problem in my tensorflow version or keras version? Currently i am using keras version = 2.2.4, python=3.6, tensorflow version = 1.11.



      InternalError                             Traceback (most recent call last)
      <ipython-input-88-16fbb44d18e3> in <module>()
      4 validation_data = test_set,
      5 validation_steps = 2000,
      ----> 6 epochs=25)

      ~Anaconda3libsite-packageskeraslegacyinterfaces.py in wrapper(*args, **kwargs)
      89 warnings.warn('Update your `' + object_name + '` call to the ' +
      90 'Keras 2 API: ' + signature, stacklevel=2)
      ---> 91 return func(*args, **kwargs)
      92 wrapper._original_function = func
      93 return wrapper

      ~Anaconda3libsite-packageskerasenginetraining.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
      1416 use_multiprocessing=use_multiprocessing,
      1417 shuffle=shuffle,
      -> 1418 initial_epoch=initial_epoch)
      1419
      1420 @interfaces.legacy_generator_methods_support

      ~Anaconda3libsite-packageskerasenginetraining_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
      215 outs = model.train_on_batch(x, y,
      216 sample_weight=sample_weight,
      --> 217 class_weight=class_weight)
      218
      219 outs = to_list(outs)

      ~Anaconda3libsite-packageskerasenginetraining.py in train_on_batch(self, x, y, sample_weight, class_weight)
      1215 ins = x + y + sample_weights
      1216 self._make_train_function()
      -> 1217 outputs = self.train_function(ins)
      1218 return unpack_singleton(outputs)
      1219

      ~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in __call__(self, inputs)
      2695
      2696 def __call__(self, inputs):
      -> 2697 if hasattr(get_session(), '_make_callable_from_options'):
      2698 if py_any(is_sparse(x) for x in self.inputs):
      2699 if py_any(is_tensor(x) for x in inputs):

      ~Anaconda3libsite-packageskerasbackendtensorflow_backend.py in get_session()
      184 config = tf.ConfigProto(intra_op_parallelism_threads=num_thread,
      185 allow_soft_placement=True)
      --> 186 _SESSION = tf.Session(config=config)
      187 session = _SESSION
      188 if not _MANUAL_VAR_INIT:

      ~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
      1509
      1510 """
      -> 1511 super(Session, self).__init__(target, graph, config=config)
      1512 # NOTE(mrry): Create these on first `__enter__` to avoid a reference cycle.
      1513 self._default_graph_context_manager = None

      ~Anaconda3libsite-packagestensorflowpythonclientsession.py in __init__(self, target, graph, config)
      632 try:
      633 # pylint: disable=protected-access
      --> 634 self._session = tf_session.TF_NewSessionRef(self._graph._c_graph, opts)
      635 # pylint: enable=protected-access
      636 finally:

      InternalError: CUDA runtime implicit initialization on GPU:0 failed. Status: unknown error






      python-3.x tensorflow keras






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 11:24









      Taimur Islam

      176215




      176215





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206781%2fcuda-runtime-implicit-initialization-on-gpu0-failed-status-unknown-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206781%2fcuda-runtime-implicit-initialization-on-gpu0-failed-status-unknown-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Academy of Television Arts & Sciences

          L'Équipe

          1995 France bombings