wchliao / multi-task-image-classification Goto Github PK
View Code? Open in Web Editor NEWMulti-task learning for image classification implemented in PyTorch.
Multi-task learning for image classification implemented in PyTorch.
thanks for sharing. ๐
You have used a 5 conv layer net in Model(), may i ask where does this architecture design comes from?
It is similar to alexnet, but different in kernel design...
If that is totally your design, why didn't you use other popular networks, like vgg etc., Can you share the consideration? And how do you know whether this architecture is effective enough or not?
Thank you and look forward to your reply. ๐
def Model(num_classes, num_channels):
layers = [
nn.Conv2d(num_channels, 32, kernel_size=3, padding=1),
nn.BatchNorm2d(32),
nn.ReLU(),
nn.Conv2d(32, 64, kernel_size=3, padding=1, stride=2),
nn.BatchNorm2d(64),
nn.ReLU(),
nn.Conv2d(64, 64, kernel_size=3, padding=1),
nn.BatchNorm2d(64),
nn.ReLU(),
nn.Conv2d(64, 128, kernel_size=3, padding=1, stride=2),
nn.BatchNorm2d(128),
nn.ReLU(),
nn.Conv2d(128, 128, kernel_size=3, padding=1),
nn.BatchNorm2d(128),
nn.ReLU(),
]
hi, i modified the input size to receive 112x112 and fc layer, but always get out of memory after running....
The locations I modified in the code are as follows:
in models.py
class _Decoder(nn.Module):
def __init__(self, output_size):
super(_Decoder, self).__init__()
self.layers = nn.Sequential(
# nn.Linear(128*8*8, 512),
nn.Linear(8 * 112 * 112, 512),
nn.BatchNorm1d(512),
nn.ReLU(),
nn.Linear(512, output_size)
)
because the input is 112x112, not 32x32 in cifar 10, so i modified the fc layer shape to avoid size mis-match problem, but
even i set batch_size to 2, it will always report cuda of memory error:
RuntimeError: CUDA out of memory. Tried to allocate 196.00 MiB (GPU 0; 11.91 GiB total capacity; 11.26 GiB already allocated; 47.06 MiB free; 50.22 MiB cached)
my gpu is titan x, has more than 12 gb memory.
Moreover,
i set os.environ["CUDA_VISIBLE_DEVICES"]='0,1'
to use 2 gpus at the same time, but it always only use 1 gpu....
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.