packtpublishing / advanced-deep-learning-with-keras Goto Github PK
View Code? Open in Web Editor NEWAdvanced Deep Learning with Keras, published by Packt
License: MIT License
Advanced Deep Learning with Keras, published by Packt
License: MIT License
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.
numpy.linalg.pinv
scipy.stats.contingency.margins
PIL.Image.fromarray
matplotlib.patches.Rectangle matplotlib.lines.Line2D
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.
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?
It seems that the calculation for fn (false negatives) is incomplete.
With "fn = abs(len(gt_class_ids) - tp)" every fp (false positive) is also a fn (false negative).
Maybe it should be: "fn = abs(len(gt_class_ids) - tp - fp)"
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?
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!
I was looking for dataset/drinks/labels_train.csv
but it doesn't seems to be there. Is there any API from which we can download this data set?
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
for i, yi in enumerate(grid_y):
for j, xi in enumerate(grid_x):
z = np.array([[xi, yi]])
x_decoded = decoder.predict(z)
ValueError: Error when checking input: expected decoder_input to have shape (16,) but got array with shape (2,)
this lib ,i have not find,and cannot import name 'gan'
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
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).
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
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?
I think i am facing issue with tf version could you please provide requirements.txt file containing all modules
After the model CVAE CNN is trained, the values of z_mean encoded on the test set is the same.
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
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
The Wasserstein GAN example fails because no lib/gan
exists.
Did @PacktPublishing intend to include the Chapter 4 DCGAN (or CGAN) as the base GAN?
hi, In the SSD object detection part. I executed evaluate code. but the result metrics were zero. I didn't know what was wrong.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.