weitang114 / mvcnn-tensorflow Goto Github PK
View Code? Open in Web Editor NEWAn Multi-View CNN (MVCNN) implementation with TensorFlow.
License: MIT License
An Multi-View CNN (MVCNN) implementation with TensorFlow.
License: MIT License
Hi, there
I have a little problem when I try to run this project.
How can I transfer my OFF file to this project needed file format?
thanks for any help
Hi, I find that after fc7, you put a fc8 and then compute the loss. But in the article, the author says that he also has a CNN2 for classification(however, the author didn't mention the structure of the CNN2……). I'm confused……
I once tried to write a customed optimizer and find compute_gradients is extremely ineffective.
opt = tf.train.AdamOptimizer(lr)
grads = opt.compute_gradients(total_loss)
# apply gradients
apply_gradient_op = opt.apply_gradients(grads, global_step=global_step)
Since you don't need the grad actually, I highly recommend you change the code to
train = tf.train.AdamOptimizer(lr).minimize(total_loss)
Hello Wei,
I have prepared the data and trained the models without changing anything. However, I found the loss converging to 3.69. Then I changed initial learning rate but obtaining same converged loss (3.69). Do you know is there any problem? By the way, could you please provide the trained weight? Thanks a lot.
thank you for your work! I want to create our own 2D dataset from 3D objects (.obj, .stl, and .off), using BlenderPhong, reported a mistake, can you please tell how to solve it.
hello there, I generated my datasets based on your BlendPhong and modelnet40, finally got images like this.
white models in black background. But when I tested the cnn with my datasets, the accuracy is only 50%~60%.when I get rid of some classes familliar such as table&night_stand, the accuracy rose to 90%. I was confused. the difference between your datasets and my datasets is lighting and camera type(ORTHO&Perspective).Does these matter?
Where does the magic numbers of 104., 116., 122. in input.py/Shape/subtract_mean come from ?
Does these numbers have special meaning?
Hi,
I am training the network initialized with alexnet_imagenet.npy using the rendered views furnished by @WeiTang114 (https://drive.google.com/open?id=0B4v2jR3WsindMUE3N2xiLVpyLW8).
The only thing I have changed is to reduce the batch size from 16 to 8 because my GPU doesn't have enough memory.
But quite quickly (after 300-400 steps) the network get stuck classifying all the inputs as class 0. (accuracy corresponding to random guess)
Can this be due to the reduction of the batch size or there is another reason?
Thank you for your help!
Hi!
Sorry...It's me again...
Can I ask if we can get a bounding box?
Cause we only get the predictions and the labels at the ending of the test process so I wonder whether there is a way to see the bounding box of the result?
So sorry...I am very new to the computer vision.
Thank you so much.
Best regards,
I use two classes(airplane and bathtub) of the modelnet40v1 dataset to train the MVCNN model.I set up 10 shapes per class in the train_lists.txt and 2 shapes per class for validation.Does anyone have the same problem?Is this a random guessing problem?
thank you for your work! I want to train the network with dataset of modelnet40v1png, but i don't know how to make the train list, can you please tell
I'm confused. In model.py, function _variable_with_weight_decay, the doc says
Note that the Variable is initialized with a truncated normal distribution.
and the code is
var = _variable_on_cpu(name, shape,initializer=tf.contrib.layers.xavier_initializer())
but in offical doc of tensorflow https://www.tensorflow.org/api_docs/python/tf/contrib/layers/xavier_initializer
the function prototype is
xavier_initializer(
uniform=True,
seed=None,
dtype=tf.float32
)
and the doc syas
uniform: Whether to use uniform or normal distributed random initialization.
So, xavier_initializer uses uniform distrubution by default.
Hi,
Can we train our model from scratch instead of using the pretrained AlexNet model?
Thank you so much!!
Best regards,
i have frozen the graph till the argmax layer
Traceback (most recent call last):
File "/media/ankit/Data/ML/MVCNN-TensorFlow/test_forzen_graph.py", line 130, in
predictions = sess.run(output_node, feed_dict={input_node:[x],y_:views})
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: transpose expects a vector of size 6. But input(1) is a vector of size 5
[[Node: import/transpose = Transpose[T=DT_FLOAT, Tperm=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_import/im0_0/_1, import/transpose/perm)]]
Caused by op u'import/transpose', defined at:
File "/media/ankit/Data/ML/MVCNN-TensorFlow/test_forzen_graph.py", line 110, in
tf.import_graph_def(graph_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.py", line 308, in import_graph_def
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): transpose expects a vector of size 6. But input(1) is a vector of size 5
[[Node: import/transpose = Transpose[T=DT_FLOAT, Tperm=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_import/im0_0/_1, import/transpose/perm)]]
update::
i think i need to initialise the placeholder variable with some tensor of size 4096 am i correct?
I am new to Python. using 3.7 and run train.py as is
File "C:\Users\Eternity\Documents\phd_thesis_inter\u05de\u05e9\u05d9\u05de\u05d5\u05ea_\u05de\u05d3\u05d5\u05e8\u05d5\u05df\u05e1\u05de\u05d9\u05e0\u05e8_\u05dc\u05de\u05d9\u05d3\u05d4_\u05e2\u05de\u05d5\u05e7\u05d4\project\code\mvcnn\MVCNN-TensorFlow-master\train.py", line 171, in main
listfiles_val, labels_val = read_lists(g_.VAL_LOL)
File "C:\Users\Eternity\Documents\phd_thesis_inter\u05de\u05e9\u05d9\u05de\u05d5\u05ea_\u05de\u05d3\u05d5\u05e8\u05d5\u05df\u05e1\u05de\u05d9\u05e0\u05e8_\u05dc\u05de\u05d9\u05d3\u05d4_\u05e2\u05de\u05d5\u05e7\u05d4\project\code\mvcnn\MVCNN-TensorFlow-master\train.py", line 182, in read_lists
listfiles, labels = zip(*[(l[0], int(l[1])) for l in listfile_labels])
ValueError: not enough values to unpack (expected 2, got 0)
[Finished in 6.3s]
I m getting below error when trying to run train.py
Traceback (most recent call last):
File "train.py", line 190, in
main(sys.argv)
File "train.py", line 177, in main
train(dataset_train, dataset_val, FLAGS.weights, FLAGS.caffemodel)
File "train.py", line 84, in train
model.load_alexnet_to_mvcnn(sess, caffemodel)
File "D:\git_hub\MVCNN-TensorFlow\model.py", line 176, in load_alexnet_to_mvcnn
caffemodel = np.load(caffetf_modelpath)
File "C:\Users\Garima\Anaconda3\envs\pytorch_new\lib\site-packages\numpy\lib\npyio.py", line 453, in load
pickle_kwargs=pickle_kwargs)
File "C:\Users\Garima\Anaconda3\envs\pytorch_new\lib\site-packages\numpy\lib\format.py", line 722, in read_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False
I am using Python3, while I think something else causes this problem.
The error appears like this:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/yetengqi/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/yetengqi/anaconda3/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/yetengqi/projects/academicContrib/multi-view-learning/MVCNN-TensorFlow/input.py", line 115, in load
shapes = list(pool.map(self._load_shape, sub))
File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/yetengqi/anaconda3/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/yetengqi/projects/academicContrib/multi-view-learning/MVCNN-TensorFlow/input.py", line 100, in _load_shape
s = Shape(listfile)
File "/home/yetengqi/projects/academicContrib/multi-view-learning/MVCNN-TensorFlow/input.py", line 15, in __init__
self.label = int(f.readline())
ValueError: invalid literal for int() with base 10: b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x07\t\t\x08\n'
The following is my analysis:
In the input.py
def __init__(self, list_file):
with open(list_file) as f:
self.label = int(f.readline())
self.V = int(f.readline())
view_files = [l.strip() for l in f.readlines()]
self.views = self._load_views(view_files, self.V)
self.done_mean = False
But in your example of train_lists.txt, the label is tagged on the second column.
for conv2, conv4, conv5, they all have parameter "group" sets to 2, which I feel is not necessary. What's the reason using it?
Hello Wei
I quite new in neural networks. I tried to run the code with not many data just to see how it will run and I am getting this error
ValueError: Dimensions must be equal, but are 48 and 27 for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,27,27,48], [?,27,27,48].
I am running in Puthon3.5.
Thanks
Vasilis
I used Tensorflow, and i was besed on VGG19. But I just got the OOM error! I had reused the variable in the loop! I used TITAN X.
hello,How do you change the picture background to white? Because I want to use another database, but the background of the data is also white.Can you introduce some methods?
Thank you for sharing, but I have a question for you. The paper says to learn a Mahalanobis distance and map it to the Mahalanobis distance through the extracted features. The feature is that the model is completed in the classification stage, so it is obtained again through the Mahalanobis distance. Is the result of another model? Can it be understood as a phased training model?
Which folder should I put 2d images rendered from 3d models? How to set the path of 2d rendering image?
I meet this problem,can you help me?
File "/media/longma/dangjisheng_windows/1axirix/MVCNN-TensorFlow1/input.py", line 27, in _load_views
im = cv2.resize(im, (W, H))
error: OpenCV(4.1.0) /io/opencv/modules/imgproc/src/resize.cpp:3718: error: (-215:Assertion failed) !ssize.empty() in function 'resize
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.