qiaoranc / tf_resnest_regnet_model Goto Github PK
View Code? Open in Web Editor NEWtensorflow 2.x version of ResNeSt,RegNet,DETR
tensorflow 2.x version of ResNeSt,RegNet,DETR
Blogger, I want to try to add it to maskrcnn, but I found that the return type is not the same as resnet. Can you write a mask rcnn with resnest as the backbone, or please give me some advice
UnknownError: 2 root error(s) found.
(0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node conv2d/Conv2D}}]]
[[loss/mul/_2675]]
(1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
[[{{node conv2d/Conv2D}}]]
0 successful operations.
0 derived errors ignored.
Hi,
From the code, when groups = 2, will the summation of radix be mixed up with other groups? For example, if there are 2 groups with 2 radices, each group must only sum up their respective radices i.e. group 1 sum radix 1 and radix 2 and group 2 sum radix 3 and radix 4. Is that the case with the code here?
Thanks
Hi, your work is great. I'm wondering maybe there is any plan to share your pre-trained weights on these models? I would really appreciate that if you can upload them. Thanks.
Hi, I'm trying to get ResNest model from models.model_factory but got the error
ValueError: Unrecognize model name resnest101
Possible the cause is here I think it should be "elif"
I have created a merge request for this issue, please help me to check it
Thank you!
I was wondering if it is normal for the build time to take >20 minutes for especially the deeper resnest models? It seems an extensive amount of recursion happens and I would receive RecursionError: maximum recursion depth exceeded in comparison
if I don't increase the Python recursion limit to 10000, and if I do increase the recursion limit it takes >20 minutes to build the layers, which seems much too long. Have you come across this or know what could be causing it? Thank you.
tensor use in the transformer,i see the encoder q,k is the same tensor which produced by the previous in the pytorch version code,but in this code we use dense api to get q,k. Are there something wrong? And beside that , the torch version code use resblocks in the transfomer and i can't find in this code .
thanks for you great work, I have a question related to your implemention of groupconv2d in keras.
I compre the pytorch's implemention and your implemention, the official pytorch implemention of groupconv2d only use one conv2d, because the .pth file only contain one conv2d with 1/2 input channel as the perameter, and your implemention use two conv2d, which makes me confused, wold mind explain it to me?
hi thank you for your code about resnetst.my issue is how i feed imagenet data to resnetst. thank you .Looking forward to your reply.
模型加载没问题,用adam优化器也没问题,但是用不了更好的RAdam优化器
@QiaoranC I'm trying to implement RegNetY on my own but I'm not able to achieve the accuracy mentioned in the paper. Did you face the same problem?
I take resnest as backbone in instance segmentation. However when trained model on my dataset, I got this error.
File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py", line 1732, in __init__ build_map_of_graph(x, finished_nodes, nodes_in_progress) File "/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py", line 1722, in build_map_of_graph layer, node_index, tensor_index) File "/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py", line 1722, in build_map_of_graph layer, node_index, tensor_index) File "/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py", line 1722, in build_map_of_graph layer, node_index, tensor_index) [Previous line repeated 11 more times] File "/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py", line 1693, in build_map_of_graph layer, node_index, tensor_index = tensor._keras_history AttributeError: 'Tensor' object has no attribute '_keras_history'
my environment:
tensorflow-gpu 1.14.0
keras 2.1.3
It seems that semantic segmentation is not supported, only image classification is supported. When I build a model with input_shape = [256, 256,3]
and n_classes = 6
, it creates a model with output shape [None,6]
. The verbose output is:
stem_out (None, 128, 128, 64)
MaxPool2D out (None, 64, 64, 64)
----- layer 0 out (None, 64, 64, 256) -----
----- layer 1 out (None, 32, 32, 512) -----
----- layer 2 out (None, 16, 16, 1024) -----
----- layer 3 out (None, 8, 8, 2048) -----
pool_out: (None, 2048)
fc_out: (None, 6)
Resnest builded with input (None, 256, 256, 4), output(None, 6)
tensorflow-gpu==2.1.0
File "F:\tf_ResNeSt_RegNet_model-master\models\ResNest.py", line 87, in call
filters = inputs.shape[self._channel_axis].value
AttributeError: 'int' object has no attribute 'value'
I wrote a model of 3D Resnest references your code, and fixed few bugs come from the original copy, by the way. I will fork and update this if you interest in.
Hello, I had a very strange problem, as if no one else had.I made two changes to make the code work.
model_name = 'ResNest50'
# inter_channels = max(in_channels * radix // reduction_factor, 32)
inter_channels = int(max(in_channels * radix // reduction_factor, 32))
https://github.com/QiaoranC/tf_ResNeSt_RegNet_model/blob/master/models/ResNest.py#L200
2. # if model_name in resnest3d_parameters.keys():
elif model_name in resnest3d_parameters.keys():
https://github.com/QiaoranC/tf_ResNeSt_RegNet_model/blob/master/models/model_factory.py#L96
keras: 2.2.5
tf: 1.14.0
code: model.save('xxx.h5')
Traceback (most recent call last):
File "/home/zhu/zhu_tf/tf_ResNeSt_RegNet_model-master/main.py", line 39, in
model.save('xxx.h5')
File "/home/zhu/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/network.py", line 1211, in save
saving.save_model(self, filepath, overwrite, include_optimizer, save_format)
File "/home/zhu/.local/lib/python3.6/site-packages/tensorflow/python/keras/saving/save.py", line 113, in save_model
model, filepath, overwrite, include_optimizer)
File "/home/zhu/.local/lib/python3.6/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 101, in save_model_to_hdf5
default=serialization.get_json_type).encode('utf8')
File "/usr/lib/python3.6/json/init.py", line 238, in dumps
kw).encode(obj)
File "/usr/lib/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/lib/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/home/zhu/.local/lib/python3.6/site-packages/tensorflow/python/util/serialization.py", line 70, in get_json_type
raise TypeError('Not JSON Serializable:', obj)
TypeError: ('Not JSON Serializable:', b'\n\x05split\x12\x06SplitV\x1a\x11activation_3/Relu\x1a\x05Const\x1a\x0fsplit/split_dim\x07\n\x01T\x12\x020\x01\x0f\n\tnum_split\x12\x02\x18\x02*\n\n\x04Tlen\x12\x020\x03')
in tf ==1.15
File "/home/team/桌面/MC/ResNest/resnest.py", line 88, in call
x_splits = tf.split(inputs, splits, self._channel_axis)
TypeError: Failed to convert object of type <class 'list'> to Tensor. Contents: [Dimension(32), Dimension(32)]. Consider casting elements to a supported type.
Hello,
Thanks for sharing your ready to train code, I was wondering if there any hope to have the pretrained weights on Image-Net ? I can contribute by adding Cascade-RCNN and Faster-RCNN to the model as having these pretrained weights will help me to test the performance of the model on a task without the need to learn Pytorch as I don't have eanough time.
If there no chance, how long do you think it will take me to train the model (Resnest-200) on Colab pro ?
Thank you.
When trying this example code given for RegNet models:
#RegNetY600
model = get_model(model_name="RegNet",input_shape=input_shape,n_classes=n_classes,
verbose=True,fc_activation=fc_activation,stage_depth=[1,3,7,4],
stage_width=[48,112,256,608],stage_G=16,SEstyle_atten="SE")
This error shows up:
TypeError Traceback (most recent call last)
in ()
----> 1 build_model()1 frames
in build_model()
31 x = img_augmentation(inputs)
32 #RegNetY600
---> 33 model = get_model(model_name='regnety400')
34 # x = layers.GlobalAveragePooling2D()(x)
35 # x = layers.Dense(1)(x)/content/models/model_factory.py in get_model(model_name, input_shape, n_classes, verbose, dropout_rate, fc_activation, **kwargs)
93 n_classes=n_classes, dropout_rate=dropout_rate, fc_activation=fc_activation,
94 stage_depth=regnet_parameters[model_name['stage_depth']],stage_width=regnet_parameters[model_name['stage_width']],
---> 95 stage_G=regnet_parameters[model_name['stage_G']],SEstyle_atten=regnet_parameters[model_name['SEstyle_atten']],**kwargs).build()
96
97 if model_name in resnest3d_parameters.keys():TypeError: string indices must be integers
hi, thank you for your amazing jobs on ResNeSt. I am trying to working on my own jobs based on your codes. but i got a few question:
[1]
in "_make_block()", when stride != 1
, we should down sampling the "short-cut" branch.
but, in "_make_block() line221-234", if self.dilation != 1, no down-sampling is apply. Is it a bug?
tf_ResNeSt_RegNet_model/models/ResNest.py
Line 228 in 7cac639
[2] "avd" and "avg_down"
as i understand, "avd" control average_downsampling in residual path, while "avg_down" control short-cut path; why not combile as one "avd"?
[3]why dropout layer is discard?
tf_ResNeSt_RegNet_model/models/ResNest.py
Line 422 in 7cac639
Are there any guidelines to implement ResNest 3D for Pytorch?
Thanks.
thank you in advance
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.