Comments (7)
from pytorchviz.
Hi,
The from_numpy()
call looks very suspicious here! If pred
is a numpy array, it cannot have autograd info associated with it.
from pytorchviz.
so the .from_numpy() bascially converts numpy array into torch.tensor
from pytorchviz.
how can I remedy this issue? @albanD
from pytorchviz.
so when I do predict on the model, am I to return the prediction as a torch tensor?
from pytorchviz.
Also, one other question I have is this:
Suppose that my model architecture is of the form:
import torch
import torch.nn as nn
from torch.autograd import Variable
class DLModel(nn.Module):
def __init__(self, layer_list):
"""
Function to initialize Deep Learning model
given a user specified layer list
Args:
layer_list (list): list of nn.Module layers from parser.py
"""
super().__init__()
self.model = nn.Sequential(*layer_list)
def forward(self, x: torch.Tensor):
pred = self.model(x) #apply model on input x
return pred
How can I use pytorchviz to visualize the model architecture where we want to see each layer/module in nn.Sequential? @albanD @szagoruyko
from pytorchviz.
so when I do predict on the model, am I to return the prediction as a torch tensor?
PyTorch autograd and training in general will only work with torch Tensors. So yes, you will have to use Tensor to be able to train this model and to visualize it as well.
How can I use pytorchviz to visualize the model architecture where we want to see each layer/module in nn.Sequential?
If you want nn.Module as well, I would recommend torchrecorder: https://torchrecorder.readthedocs.io/en/latest/
from pytorchviz.
Related Issues (20)
- No text label displayed on Google Colab (Pytorch 1.8.1) HOT 1
- Add variable names to nodes HOT 5
- Incorrect graph for saved variable using custom autograd function HOT 5
- Inconsistent arrow directions for saved variables HOT 2
- Graph terminates in small horizontal bar HOT 1
- RecursionError when used on subclass of Tensor HOT 5
- Page beyond pdf interface
- Lisibility of saved tensor HOT 1
- 'NotImplementedError:' when passing multiple input to model()
- Failing on large digraph HOT 3
- torchviz module not found HOT 2
- Plotting model HOT 1
- AttributeError in make_dot with GNN from dgl.ai HOT 1
- Supress a model/nn.module
- How to plot transformer model? (BERT Model) HOT 3
- Pytorchviz with detectron2
- My data must be some integer data,how to do
- Depends on distutils, which has been removed from python3.12 HOT 8
- add color themes - drafted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorchviz.