Code showing error

while running the code of prateek sir for generating fake images using gans a error raised :

InternalError Traceback (most recent call last)
in
20 #Fake Data X
21 noise = np.random.normal(0,1,size=(HALF_BATCH,NOISE_DIM))
—> 22 fake_imgs = generator.predict(noise) #Forward
23
24

~\Anacondanew\lib\site-packages\keras\engine\training.py in predict(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing)
1460 verbose=verbose,
1461 steps=steps,
-> 1462 callbacks=callbacks)
1463
1464 def train_on_batch(self, x, y,

~\Anacondanew\lib\site-packages\keras\engine\training_arrays.py in predict_loop(model, f, ins, batch_size, verbose, steps, callbacks)
322 batch_logs = {‘batch’: batch_index, ‘size’: len(batch_ids)}
323 callbacks._call_batch_hook(‘predict’, ‘begin’, batch_index, batch_logs)
–> 324 batch_outs = f(ins_batch)
325 batch_outs = to_list(batch_outs)
326 if batch_index == 0:

~\Anacondanew\lib\site-packages\tensorflow_core\python\keras\backend.py in call(self, inputs)
3738 value = math_ops.cast(value, tensor.dtype)
3739 converted_inputs.append(value)
-> 3740 outputs = self._graph_fn(*converted_inputs)
3741
3742 # EagerTensor.numpy() will often make a copy to ensure memory safety.

~\Anacondanew\lib\site-packages\tensorflow_core\python\eager\function.py in call(self, *args, **kwargs)
1079 TypeError: For invalid positional/keyword argument combinations.
1080 “”"
-> 1081 return self._call_impl(args, kwargs)
1082
1083 def _call_impl(self, args, kwargs, cancellation_manager=None):

~\Anacondanew\lib\site-packages\tensorflow_core\python\eager\function.py in _call_impl(self, args, kwargs, cancellation_manager)
1119 raise TypeError(“Keyword arguments {} unknown. Expected {}.”.format(
1120 list(kwargs.keys()), list(self._arg_keywords)))
-> 1121 return self._call_flat(args, self.captured_inputs, cancellation_manager)
1122
1123 def _filtered_call(self, args, kwargs):

~\Anacondanew\lib\site-packages\tensorflow_core\python\eager\function.py in _call_flat(self, args, captured_inputs, cancellation_manager)
1222 if executing_eagerly:
1223 flat_outputs = forward_function.call(
-> 1224 ctx, args, cancellation_manager=cancellation_manager)
1225 else:
1226 gradient_name = self._delayed_rewrite_functions.register()

~\Anacondanew\lib\site-packages\tensorflow_core\python\eager\function.py in call(self, ctx, args, cancellation_manager)
509 inputs=args,
510 attrs=(“executor_type”, executor_type, “config_proto”, config),
–> 511 ctx=ctx)
512 else:
513 outputs = execute.execute_with_cancellation(

~\Anacondanew\lib\site-packages\tensorflow_core\python\eager\execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
65 else:
66 message = e.message
—> 67 six.raise_from(core._status_to_exception(e.code, message), None)
68 except TypeError as e:
69 keras_symbolic_tensors = [

~\Anacondanew\lib\site-packages\six.py in raise_from(value, from_value)

InternalError: Blas GEMM launch failed : a.shape=(32, 100), b.shape=(100, 256), m=32, n=256, k=100
[[node dense_1/MatMul (defined at C:\Users\Dibakar Chaudhary\Anacondanew\lib\site-packages\tensorflow_core\python\framework\ops.py:1751) ]] [Op:__inference_keras_scratch_graph_390]

Function call stack:
keras_scratch_graph

Hey @dibakarchaudhary58, yes just change the import statemente, to these statements, with the introduction of tensorflow 2.0 some changes needs to be made.

import tensorflow as tf

tf.compat.v1.disable_eager_execution()

from keras.datasets import mnist
from tensorflow.python.keras.layers import *
from tensorflow.python.keras.layers.advanced_activations import LeakyReLU
from tensorflow.python.keras.models import Sequential,Model
from tensorflow.compat.v1.keras.optimizers import Adam

import matplotlib.pyplot as plt
import math
import numpy as np 

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.