Git Product home page Git Product logo

advanced-deep-learning-with-keras's Issues

Project dependencies may have API risk issues

Hi, In Advanced-Deep-Learning-with-Keras, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

numpy
scipy
Pillow
matplotlib
scikit-image
tensorflow-gpu
h5py
graphviz
pydot
pydot_ng
tensorflow-addons
termcolor
gym
tensorflow-probability

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict.
The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project,
The version constraint of dependency numpy can be changed to >=1.8.0,<=1.23.0rc3.
The version constraint of dependency scipy can be changed to >=0.10.0,<=1.8.1.
The version constraint of dependency Pillow can be changed to ==9.2.0.
The version constraint of dependency Pillow can be changed to >=2.0.0,<=9.1.1.
The version constraint of dependency matplotlib can be changed to >=0.86,<=0.86.2.
The version constraint of dependency matplotlib can be changed to >=1.3.0,<=3.0.3.
The version constraint of dependency scikit-image can be changed to >=0.9.0,<=0.11.3.

The above modification suggestions can reduce the dependency conflicts as much as possible,
and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the numpy
numpy.linalg.pinv
The calling methods from the scipy
scipy.stats.contingency.margins
The calling methods from the Pillow
PIL.Image.fromarray
The calling methods from the matplotlib
matplotlib.patches.Rectangle
matplotlib.lines.Line2D
The calling methods from the scikit-image
skimage.util.random_noise
skimage.img_as_float

@developer
Could please help me check this issue?
May I pull a request to fix it?
Thank you very much.

Warning for dcgan-mnist-4.2.1.py

UserWarning: Discrepancy between trainable weights and collected trainable weights, did you set `model.trainable` without calling `model.compile` after ?

I have yet to figure out whether this is a serious issue.
Is there a clean way to get rid of this warning?

Error occurred when finalizing GeneratorDataset iterator | Trying to run image segmentation on custom dataset

Hello, I am trying to train the segmentation model on my custom dataset, which has two classes 1: Copper and 2:Belmouth.
I used generate_gt_segmentation.py codes to convert JSON to .npy file.
While running the training process on google colab tf version 2.4.1 getting following error:

tensorflow.python.framework.errors_impl.ResourceExhaustedError:  OOM when allocating tensor with shape[4,16,720,1280] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
	 [[node fcn/ResNet56v2/conv2d_18/Conv2D (defined at fcn-12.3.1.py:154) ]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
 [Op:__inference_train_function_16535]

Function call stack:
train_function

2021-04-05 18:46:10.106657: W tensorflow/core/kernels/data/generator_dataset_op.cc:107] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated.
	 [[{{node PyFunc}}]]

I also noticed that data_generator.py code give the # of class = 4, which is wrong also number of classes supposed to be 3. How may I solve the issue?

Why the last dimension of the tensor is size=4

Hi,

I just started ith Object Detection and I'm finding this book incredibly useful. As I'm now going throug the function "anchor_boxes" withon the script "layer_utils.py", I do not completely understand why the tensor of anchor boxes has this dimensions:
tensor = (feature_map_height, feature_map_width, n_boxes, 4)

I do not understand why the last dimension is size 4. What is the reason behind it?

Thank you!

possibly unnecessary multiplication at the mask_offset function?

At the chapter11-detection/loss.py mask_offset function, multiplying offset with the mask (line 85) seems unnecessary to me, because the rows of the offset which are not assigned to an object are already zero. This is not a bug obviously, but maybe unnecessary, am I right?
Thank you

In dqn-cartpole-9.6.1.py, line 115, where does "reward" variable come from?


def get_target_q_value(self, next_state):
        # max Q value among next state's actions
        if self.ddqn:
            # DDQN
            # current Q Network selects the action
            # a'_max = argmax_a' Q(s', a')
            action = np.argmax(self.q_model.predict(next_state)[0])
            # target Q Network evaluates the action
            # Q_max = Q_target(s', a'_max)
            q_value = self.target_q_model.predict(next_state)[0][action]
        else:
            # DQN chooses the max Q value among next actions
            # selection and evaluation of action is on the target Q Network
            # Q_max = max_a' Q_target(s', a')
            q_value = np.amax(self.target_q_model.predict(next_state)[0])

        # Q_max = reward + gamma * Q_max
        q_value *= self.gamma
        q_value += reward
        return q_value

Invalid Argument Error

Hello,
When I tried to run the dcgan, cgan or wagan mode. I have a same error.
InvalidArgumentError: You must feed a value for placeholder tensor 'discriminator_input_5' with dtype float and shape [?,28,28,1]
[[node discriminator_input_6 (defined at C:/Users/xx/xx/xx.py:181) ]] [Op:__inference_keras_scratch_graph_40533]
Function call stack:
keras_scratch_graph
(the tensor name changes every time).

possible error at calculating the number of boxes

At chapter11-detection/data_generator.py , in get_n_boxes(self) function, at line 85,
self.n_boxes += np.prod(shape) // self.n_anchors

to calculate the number of boxes, it should be divided by 4 (xmin, xmax, ymin, ymax) but not the "self.n_anchors". In default, n_anchors = aspect_ration(3) + 1 = 4 works, but if we change the aspect ratio, it will give an error.

thank you

SSD train

HI I have some question.
I'm trying to train SSD model.

just clone your repository and run 'python ssd-11.6.1.py --train'

I think your weights files epoch is 200.
so I training 200 epoch.

but inference result was very low

can you give me a comment about SSD train way?

issue with tf version

I think i am facing issue with tf version could you please provide requirements.txt file containing all modules

SSD Data Generator in Keras

Hi,

I have a question regarding on of the methods in DataGenerator ('data_generator.py') within the SSD model in Keras.

In the method def get_n_boxes , self.n_boxes is obtained as follows:
self.n_boxes += np.prod(shape) // self.n_anchors

However, shouldnt it be obtained in this way?:
self.n_boxes += np.prod(shape) * self.n_anchors

Isn't it the total number of boxes the result of multiplying the number of anchor boxes per feature map point by the total number of feature maps?

Thank you!
Pedro

Error for dcgan-mnist-4.2.1.py

Thank you for your greate tutor. but when i run dcgan-mnist-4.2.1.py . It shows error:tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'discriminator_input' with dtype float and shape [?,28,28,1]
[[{{node discriminator_input}}]]

I just copy your code and run it and therefore it raise the error

ssd evaluate

hi, In the SSD object detection part. I executed evaluate code. but the result metrics were zero. I didn't know what was wrong.

image

below is the code I executed

git clone https://github.com/PacktPublishing/Advanced-Deep-Learning-with-Keras.git
cd Advanced-Deep-Learning-with-Keras-master/chapter11-detection
python3 ssd-11.6.1.py --restore-weights=ResNet56v2-4layer-norm-smooth_l1-extra_anchors-drinks-200.h5 --evaluate --normalize

I use docker. my image is [tensorflow/tensorflow:latest-gpu-py3-jupyter] .
my python version is 3.6.9 and tf version is 2.1.0

thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.